• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

Java version.

 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends ,

I was having java 1.4 installed on my machine. Now , recently i upgraded to 1.5. However when i goto command prompt and type this :

> java -version

it still says 1.4 releated things.

Can someone let me know how would the new 1.5 come in effect. I need to use new 1.5 features like static imports , enums etc.

Thanks in Advance.

Yogendra N Joshi.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't feel that it should be in the Advanced forum
Please check your PATH variable. It probably contains a directory pointing to version 1.4 of your compiler.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, You have to put the absolute path of the bin directory (in my case "C:\Archivos de programa\Java\jdk1.5.0\bin") in an environment varible called "path"; In windows have to check the system32 directory, if there are java.exe and javac.exe you have to move out them.
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mike / Satou ,

I tried doing as told by you... But it didnt work out.

I moved java.exe , javaw.exe , javaws.exe from system32 folder and added an entry for PATH variable as C:\Program Files\Java\jdk1.5\bin

and then i went to cmd again and tried. Still its 1.4

Please help out.

Thanks
Yogendra
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly does your PATH environment variable contain now?
Did you restart the computer after changing the PATH?
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You most likely need to put the new path pointing to the Java 1.5 JDK at the front of your PATH variable. I've seen a similar problem before when another program I've installed has modified my PATH for me and over-ridden the JDK that I had specified.

In short, your system will use the first JDK it finds in your PATH. So if you have

PATH = .;C:\Program Files\Java\jdk1.4.2\bin;C:\Program Files\Java\jdk1.5\bin

you system will use the 1.4.2 JDK.

If you find that this is the case, just remove the older one, or rearrange them so that 1.5 comes first.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic