• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Newer version of java

 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have java j2re1.4.12 installed on my desktop. I have installed newer version jre6. How can I check which version is in effect now ?
In previous version , it says j2re while in new version it says jre. Why did 2 disappear ?
If older version is in effect , how can I replace it with new version ?
In the "PATH" variable, path shown is c:\WINDOWS\system32" , where java.exe file is kept. At the same time , there is java.exe file in the path "C:\Program Files\Java\j2re1.4.2_04\bin". When file is in two places, the one in "PATH" variable will be used for executing class files ?
How can I check, what version of java.exe file is in use ? I clicked on the properties of java.exe specifies in "PATH" variable and it shows "6.0.110.3" under version tab, does it mean that version 6 is in use instead of version 4 ? If yes, then how did version 4 got replaced with version 6 ?

java.exe and javac.exe are two different files, right ?
We need javac.exe file for compiling source code. javac.exe file is nowhere in the path "C:\WINDOWS\system32" and I dont see this file anywhere in thye bin folder. So how can javac.exe be used ?

thanks
 
author
Posts: 23956
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

How can I check, what version of java.exe file is in use ? I clicked on the properties of java.exe specifies in "PATH" variable and it shows "6.0.110.3" under version tab, does it mean that version 6 is in use instead of version 4 ? If yes, then how did version 4 got replaced with version 6 ?



The easiest way to tell which java is specified by the PATH, is from the command line, run ... java -version

java.exe and javac.exe are two different files, right ?
We need javac.exe file for compiling source code. javac.exe file is nowhere in the path "C:\WINDOWS\system32" and I dont see this file anywhere in thye bin folder. So how can javac.exe be used ?



Javac is the compiler, and it will be installed when you install the JDK. Since you installed the JRE (Java runtime environment), you don't have the Java compiler installed.

Henry
 
jignesh soni
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the reply.
Can you please answer following questions

1) If I want to replace older version with newer version, what shall I do ? change the value in "PATH" variable ?

2) If I logon to a machine where JDK is already installed, where can I check javac ?

4) javac compiles source code and java executes class files. Value in the
"PATH" variable compiles source code or executes class file ? If it executes class files then what value do I set in the "CLASSPATH" variable ?
Can we use "PATH" variable and "CLASSPATH" variable interchangeably ? Can I create my custom environment variables and set the java.exe and javac.exe files in there or does it have to be in "PATH" and "CLASSPATH" variables only ?
 
Sheriff
Posts: 22789
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by jignesh soni:
In previous version , it says j2re while in new version it says jre. Why did 2 disappear ?


Because Java 1.4 was the last version of Java to be labeled as Java 2. Java 1.5 is Java 5.0, Java 1.6 is Java 6. There is also no more J2SE but just Java SE.

If older version is in effect , how can I replace it with new version ?


Normally, when you install Java 1.4 first and then Java 6, you don't need to do anything.

Should you still want to change it, this explains how:
The java.exe and javaw.exe in the system32 folder look in the registry.
If you open it (it's called regedit.exe; be very careful!), and open the path to HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment, on the right there is a key-value pair with the key being called "CurrentVersion". This specifies the sub tree on the left to use. My PC says "1.6" so it looks in the "1.6" sub tree and sees my Java home is "C:\Program Files\Java\jre6".
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic