LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Using two versions of Java (https://www.linuxquestions.org/questions/linux-software-2/using-two-versions-of-java-368906/)

UmneyDurak 10-01-2005 11:09 PM

Using two versions of Java
 
Hi.
I'm trying to run two version of java on my machine, v1.3 and v1.5. I modified this method to do it: http://stanton-finley.net/fedora_cor...otes.html#Java
So in java.sh I added another path to 1.5 jdk/bin under JAVA_HOME15.
And run install and config for java, and javac for version 1.5. It seems to be working, but I was wodering if this is a correct way of doing this.
Thx.

paulsm4 10-02-2005 12:32 AM

The stanton-finley.net is oriented toward users (emphasis on JRE), you're probably equally interested in development (as am I).

Bottom line: there's no problem in having multiple versions, and what you've done sounds correct.

I'd make things even simpler, however:

1. Have a little "setenv" script in each of your project directories, e.g.
JAVA_PATH="/usr/java/jdk1.5.0_03"

export PATH="$PATH:$JAVA_PATH/bin"
export JAVA_BINDIR="$JAVA_PATH/bin"
export JAVA_ROOT="$JAVA_PATH"
export JAVA_HOME="$JAVA_PATH"
export JRE_HOME="$JAVA_PATH/jre"
export JDK_HOME="$JAVA_PATH"
export SDK_HOME="$JAVA_PATH"

2. "source" it with this syntax:

. ./setenv

3. Voila! Your command line environment is set for this particular version of Java

4. It's worth noting that most IDEs (including both Netbeans and Eclipse)
let you specify one or another JDK's in their respective "project options".

'Hope that helps .. PSM


All times are GMT -5. The time now is 06:14 PM.