•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 425,819 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,031 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 750 | Replies: 22
![]() |
•
•
•
•
How odd. As I stated before,
I am using Java Eclipse SDK and within it says
-JRE System Library [jdk 1.5]-
and about 1/3 of the programs give me a compiler error. I talked to a programmer and my uncle's office and he said yeah, some things are different so it wont work out as the tutorial says.
You should upgrade.
I'll give you a link to my Instructor's website (via pm) - has all of the steps to upgrade to 6.0 in the event that you forget a step.
•
•
Join Date: Jul 2008
Posts: 92
Reputation:
Rep Power: 1
Solved Threads: 1
Interesting you should say that 1.6 is backwards compatible. I just talked with the programmer at work, and he said that in 1.5, they removed certain functions such as assert or format, but it was re-instituted in 1.6. He said the purpose of using 1.5 is because it is the most stable version right now, and every software related piece in the company runs off of 1.5
Now I am stuck, he told me to keep 1.5, but if I don't change it, I won't understand most of those online tutorials.
Now I am stuck, he told me to keep 1.5, but if I don't change it, I won't understand most of those online tutorials.
•
•
•
•
How odd. As I stated before,
I am using Java Eclipse SDK and within it says
-JRE System Library [jdk 1.5]-
and about 1/3 of the programs give me a compiler error. I talked to a programmer and my uncle's office and he said yeah, some things are different so it wont work out as the tutorial says.
That is the runtime. Has nothing to do with the compilation. Eclipse has it's own compiler and you can set it to expect source from anywhere form 1.4 to 1.6.
Look at your preferences
Windows->Preferences Java->Compiler Compiler compliance level
And at your project properties
Project->Properties Java Compiler (if "Enable project specific settings" is checked) Compiler compliance level
The problems you listed above are actually caused by code for 1.5 or later being compiled at a 1.4 compliance level.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Jul 2008
Posts: 92
Reputation:
Rep Power: 1
Solved Threads: 1
So my compiler compliance level is 1.4
and for the second part under properties, "Enable project specific settings" is not checked off.
How do i resolve these problems and not get that compiler error when using programs from the Java Sun site??
-------------------------------------------------------------------------------------------------------------------
In addition, I was reading someone's post on how to create an instant messenger program, which lead me to this website
http://java.sun.com/developer/online...a2/socket.html
So I copied the scripts of Example 1 into my Java client, and the client script of example 1 did not work. I run it, and it opens for about 2 seconds, then closes, and the console says Unknown host: kq6py.eng
I don't think this is because of my compiler version or anything, because I didn't get any compiler errors.
and for the second part under properties, "Enable project specific settings" is not checked off.
How do i resolve these problems and not get that compiler error when using programs from the Java Sun site??
-------------------------------------------------------------------------------------------------------------------
In addition, I was reading someone's post on how to create an instant messenger program, which lead me to this website
http://java.sun.com/developer/online...a2/socket.html
So I copied the scripts of Example 1 into my Java client, and the client script of example 1 did not work. I run it, and it opens for about 2 seconds, then closes, and the console says Unknown host: kq6py.eng
I don't think this is because of my compiler version or anything, because I didn't get any compiler errors.
Last edited by bloody_ninja : Jul 11th, 2008 at 2:28 am.
•
•
•
•
So my compiler compliance level is 1.4
and for the second part under properties, "Enable project specific settings" is not checked off.
How do i resolve these problems and not get that compiler error when using programs from the Java Sun site??
Change the compiler compliance level to 5.0 or 6.0 (and, if you're version won't let you, upgrade Eclipse).
•
•
•
•
-------------------------------------------------------------------------------------------------------------------
In addition, I was reading someone's post on how to create an instant messenger program, which lead me to this website
http://java.sun.com/developer/online...a2/socket.html
So I copied the scripts of Example 1 into my Java client, and the client script of example 1 did not work. I run it, and it opens for about 2 seconds, then closes, and the console says Unknown host: kq6py.eng
I don't think this is because of my compiler version or anything, because I didn't get any compiler errors.
No, it's because you need to change the hostname referenced in the program. Your hostname is, seemingly, not kq6py.
You need to change
socket = new Socket("kq6py", 4321);socket = new Socket("<your hostname or ip address>", 4321); Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
•
•
Oh yes, and it also says this is the compiler/interpreter commands to run the program. Exactly where to I insert or paste this? :
javac SocketServer.java
javac SocketClient.java
java SocketServer
java SocketClient
You don't, if you're using Eclipse for this. Eclipse has it's own compile and run functions (which you, hopefully, already know how to use).
You use those commands if you are compiling and running the things manually from the command line.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
I'm not sure if you can run two programs from Eclipse at the same time. You're probably better off compiling and running these from the command line (one command shell per).
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- FT Junior Java Developer Needed for Major Media firm in NYC (Software Development Job Offers)
- Java/J2EE Senior Software Engineer (Software Development Job Offers)
- Front-end Java Software Engineer for Digital Video/Media Market Leader (Software Development Job Offers)
- Senior Software Engineer (Java) (Web Development Job Offers)
- Java Software Engineer (Software Development Job Offers)
- Java Front-end Developer Engineer for Stealth Media Start-up (Software Development Job Offers)
- Java Developer Required (Software Development Job Offers)
Other Threads in the Java Forum
- Previous Thread: java homework errors
- Next Thread: tar file



Linear Mode