![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Programming Talk This forum is for all programming questions. The questions do not have to be directly related to Ubuntu and any programming language is allowed. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
5 Cups of Ubuntu
![]() Join Date: Jul 2006
Beans: 24
Ubuntu 9.10 Karmic Koala
|
Need Help on JAVA_HOME, CLASSPATH set up
I need step-by-step instructions on how to set up the JAVA_HOME and CLASSPATH variables. Can anyone help me out with this issue?
Thanks in advance. |
|
|
|
|
|
#2 |
|
5 Cups of Ubuntu
![]() Join Date: Apr 2006
Beans: 10
|
Re: Need Help on JAVA_HOME, CLASSPATH set up
it depends on what implementation of java you have installed, where it is installed, and a number of other things.
If you already know what you want to set JAVA_HOME and CLASSPATH to, you can just run Code:
sudo gedit /etc/environment |
|
|
|
|
|
#3 |
|
5 Cups of Ubuntu
![]() Join Date: Jul 2006
Beans: 24
Ubuntu 9.10 Karmic Koala
|
Re: Need Help on JAVA_HOME, CLASSPATH set up
Thanks tedwardo2, it worked perfectly fine.
See you around. |
|
|
|
|
|
#4 |
|
5 Cups of Ubuntu
![]() Join Date: Jul 2006
Beans: 24
Ubuntu 9.10 Karmic Koala
|
Re: Need Help on JAVA_HOME, CLASSPATH set up
This is the output of the "etc/environment" file after I "gedit" it,
Code:
PATH="/usr/local/Java/jdk1.5.0_07/bin:.:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games"
LANG="en_AU.UTF-8"
LANGUAGE="en_AU:en"
JAVA_HOME="/usr/local/Java/jdk1.5.0_07"
CLASSPATH="/usr/local/Java/jdk1.5.0_07/lib:."
Last edited by DapperDrakeNewbieDR; October 22nd, 2006 at 05:43 PM.. |
|
|
|
|
|
#5 |
|
First Cup of Ubuntu
![]() Join Date: Jul 2007
Beans: 6
|
Re: Need Help on JAVA_HOME, CLASSPATH set up
i'm having the same problem, but i don't know exactly what to do. i installed jdk and jre trough apt-get but i can't find "/usr/local/Java/jdk1.5.0_07/bin:." or any of the others path you used.
The best i was able to do was to find the java folder in usr/share but i can't find anything like jdk1.5.0_07/bin:. in it. This is the content of the java folder : ![]() wich path should i use? doi need to install somtging else? atm the content of my etc/environment is: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" LANG="it_IT.UTF-8 thx in advice for help P.S. sry for may bad english |
|
|
|
|
|
#6 |
|
Chocolate-Covered Ubuntu Beans
![]() Join Date: Jun 2005
Location: London, England
Beans: 2,312
Kubuntu 7.10 Gutsy Gibbon
|
Re: Need Help on JAVA_HOME, CLASSPATH set up
The easiest way to find it is to use the command
whcih java which probably says /usr/bin/java, but this is a symlink. if you do ls -l /usr/bin/java it will tell you where it links to (probably another symlink). Keep on followinf the symlinks until you find the real executable. It's there somewhere. If you install java straight from Sun, it defaults into /opt/java..., but the Ubuntu packagers tend to put java in /usr/lib or /usr/share or something like that. P.S. With the Sun JRE, you don't normally need to set JAVA_HOME or CLASSPATH at all. |
|
|
|
|
|
#7 |
|
First Cup of Ubuntu
![]() Join Date: May 2008
Beans: 1
|
If you have installed java through sudo apt-get install ......
then it is installed in /usr/lib/jvm |
|
|
|
|
|
#8 |
|
5 Cups of Ubuntu
![]() Join Date: Jul 2007
Location: Brussels
Beans: 22
Ubuntu 9.04 Jaunty Jackalope
|
Re: Need Help on JAVA_HOME, CLASSPATH set up
euhm.. is my case:
which java /usr/bin/java ls -l /usr/bin/java /usr/bin/java -> /etc/alternatives/java ls -l /etc/alternatives/java /etc/alternatives/java -> /usr/lib/jvm/java-gcj/jre/bin/java Changed that to: java -> /usr/lib/jvm/java-6-sun-1.6.0.06/jre/bin/java then I added the following line to /etv/environment: JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.06/" and created the following symlink: /usr/java/jdk -> /usr/lib/jvm/java-6-sun-1.6.0.06/ although I have both... java is sooooo confusing!!
__________________
HW: Intel Core 2 CPU T7400 @ 1.66GHz, Dell Latitude D620, Intel Mobile 945GM/PM/GMS 943/940GML Express IGP + ICH7-M, 2014MB, 160GB, 1280x800 -- OS: Gentoo 2004-2010 & Ubuntu 7.4-9.10 Last edited by bwakkie; June 30th, 2008 at 09:54 AM.. |
|
|
|
|
|
#9 | |
|
5 Cups of Ubuntu
![]() Join Date: Apr 2007
Beans: 23
Ubuntu 9.04 Jaunty Jackalope
|
Quote:
Code:
sudo update-java-alternatives -s java-6-sun |
|
|
|
|
|
|
#10 | |
|
A Carafe of Ubuntu
![]() Join Date: Apr 2005
Location: Valby, Denmark
Beans: 128
Ubuntu 9.10 Karmic Koala
|
Quote:
I was wondering why my netbank didn't work anymore - but when I ran java --version gcj had stolen my settings from sun being default... Even after running that command to set java alternatives firefox hangs and uses up 100% cpu time when trying to access my netbank |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|