• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot compile in 1.5

 
Nischal Topno
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Nischal Topno
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, "java" is 1.5, but what about "javac"? Run:
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeff Albrechtsen:
Okay, "java" is 1.5, but what about "javac"? Run:


Or just "javac -version" -- new switch in Java 5!
 
Nischal Topno
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to compile the file in the bin folder itself, but still it does not compile.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15354
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Install JDK 5 properly, that will solve your problem.
Just copying the jdk1.5.0 folder from another machine does not work.
 
Stuart Ash
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't you have to import LinkedList?

Mark
 
Nischal Topno
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic