Forums Register Login

Cannot compile in 1.5

+Pie Number of slices to send: Send
I just started with java 1.5 and I am not able to compile the following code:

It throws the following error:

I have not installed the jdk 5 but copied the "j2sdk1.5.0" folder from another machine. I earlier thought it to be a path problem so i copied my source file in to j2sdk1.5.0\bin folder and tried compiling it, which gave me the same error.

Can any body help me the silliest mistake i am making.

Nischal
+Pie Number of slices to send: Send
 


I have not installed the jdk 5


Hmm. This might be the source of your problem. Run "java -version" to see which version you are really using.
+Pie Number of slices to send: Send
I did thought that this might be an issue & so have changed the path and other variables to point to the folder where this jdk is copied. Following is the output:
+Pie Number of slices to send: Send
Okay, "java" is 1.5, but what about "javac"? Run:
+Pie Number of slices to send: Send
 

Originally posted by Jeff Albrechtsen:
Okay, "java" is 1.5, but what about "javac"? Run:



Or just "javac -version" -- new switch in Java 5!
+Pie Number of slices to send: Send
Hi,

I am trying to compile the file in the bin folder itself, but still it does not compile.
+Pie Number of slices to send: Send
Install JDK 5 properly, that will solve your problem.
Just copying the jdk1.5.0 folder from another machine does not work.
+Pie Number of slices to send: Send
Use Java5 with Eclipse as your editor. Eclipse gives you compliance options (1.3, 1.4, 5), so you can be aware of what version of Java you are coding to.
+Pie Number of slices to send: Send
Also, your version shows that it is a beta version of Java 1.5. So that is over a year old. Java 1.5 is in production for over a year.

I suggest downloading the SDK from sun and installing it.

Mark
+Pie Number of slices to send: Send
Don't you have to import LinkedList?

Mark
+Pie Number of slices to send: Send
Hi Mark,

I did realize the mistake. I corrected the source file, but still i don't get through with compiling. As suggested by others, let me download the latest version of jdk5, install it, and check out.

Nischal
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 735 times.
Similar Threads
LinkedList using Generics
more tiger questions
Why is Java Generic called generic?
Type Information Not available at runtime.
LinkedList problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 07:33:48.