View Full Version : JAVA installed ..dont know how to set the JAVA_HOME and CLASSPATH

April 8th, 2011, 10:18 AM

I have installed the sun-java6 using apt-get install.
it got interrupted and aked me to configure it.so i used sudo apt-get -f install to complete the installation.it shoed the correct version of java by using java -version
$ java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing)
i got that java installed properly.but getting confusion while setting the environment variable and class path..i gooled about 2hrs but nothing worked.please tell me the step by step process of setting the java_home,class path.
right now java is in this location:

thanks in advance!!

April 8th, 2011, 10:31 AM
Here's an article (http://download.oracle.com/javase/tutorial/essential/environment/paths.html) you may find useful.

Those environment settings are usually more of a concern in the Windows world. I've been running Java just fine in Linux without worrying about them. Do you have a problem you're trying to solve by setting them? Maybe if you describe the problem, we can suggest a solution.

April 8th, 2011, 10:31 AM
Have a look at this thread: http://ubuntuforums.org/showthread.php?t=217936&highlight=classpath

April 8th, 2011, 11:02 PM
I've been running Java just fine in Linux without worrying about them.

I can't remember the last time I set these things.

April 29th, 2011, 06:03 AM
If you really want(need) to set these environment variables, you can always set them in the .bashrc file.