Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 19032 - java-config does not set user vm correctly
Summary: java-config does not set user vm correctly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on: 9899
Blocks: 31468
  Show dependency tree
 
Reported: 2003-04-09 06:30 UTC by Marco Hennings
Modified: 2003-11-08 10:36 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Hennings 2003-04-09 06:30:27 UTC
The error happens to me too.

Each time i run java-config i have to manualy edit .gentoo/java-env

What goes wrong?
The System VM is set via env-update and appears in the path. Since the java path
is appended and not prepended "which java" returns teh system vm and not the
user vm.

I've created a patch for the 0.2.8 version. It changes the order, but confuses
java-config a bit. Every run of java-config appends a new path. :(

--- /usr/bin/java-config        2003-04-09 12:04:05.000000000 +0200
+++ java-config 2003-04-09 11:59:37.000000000 +0200
@@ -209,7 +209,7 @@
        ( . $file ;
        for i in $ENV_VARS ; do
                if [ $i == "ADDPATH" ] && [ -z "$system" ]; then
-                       echo "PATH=${!i}":\${PATH}
+                       echo "PATH=\${PATH}:${!i}"
                elif [ $i == "ADDPATH" ] && [ "$system" ]; then
                        echo "PATH=${!i}"
                        echo "ROOTPATH=${!i}"
Comment 1 Mike Hostetler 2003-04-10 10:38:14 UTC
I changed the ~/.gentoo/java-env file to this, and then sourced it in my ~/.bashrc.  It seems to clear it up:

--- .gentoo/java-env    2002-10-31 08:02:29.000000000 -0600
+++ .gentoo/java-env.mikeh      2002-11-22 12:49:25.000000000 -0600
@@ -1,10 +1,10 @@
-# Autogenerated by java-config 0.2.5
-# Cmd: /usr/bin/java-config --set-user-vm=sun-jdk-1.4.1.01
-JAVA_HOME=/opt/sun-jdk-1.4.1.01
-CLASSPATH=/opt/sun-jdk-1.4.1.01/lib/rt.jar:.
-JDK_HOME=/opt/sun-jdk-1.4.1.01
-JAVAC=/opt/sun-jdk-1.4.1.01/bin/javac
-PATH=${PATH}:/opt/sun-jdk-1.4.1.01/bin:/opt/sun-jdk-1.4.1.01/jre/bin
+## re-written by mikeh, until they fix java-config
+JDK_HOME=`java-config --jdk-home`
+JRE_HOME=$JDK_HOME/jre
+JAVA_HOME=$JDK_HOME
+CLASSPATH=$JRE_HOME/lib/rt.jar:.
+JAVAC=$JAVA_HOME/bin/javac
+PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:${PATH}
 if [ -f /home/mikeh/.gentoo/java-env-classpath ] ; then
        . /home/mikeh/.gentoo/java-env-classpath
 fi
Comment 2 Adrian Almenar 2003-07-01 20:44:13 UTC
Im not having enough time to work on gentoo NOW, i can help on these later.
Comment 3 Adrian Almenar 2003-11-08 10:36:38 UTC
Fixed on java-config CVS, will be available in java-config 1.1.5.

Reopen if you have problems.