Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 32347 - java-config --list-available-vms falls over
Summary: java-config --list-available-vms falls over
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 31468
  Show dependency tree
 
Reported: 2003-10-30 15:22 UTC by george
Modified: 2007-05-31 10:52 UTC (History)
0 users

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 george 2003-10-30 15:22:56 UTC
bash-2.05b# java-config --list-available-vms
Traceback (most recent call last):
  File "/usr/bin/java-config", line 87, in ?
    run(do_me)
  File "/usr/bin/java-config", line 37, in run
    func = name()
  File "/usr/lib/python2.2/site-packages/java_config/jc_options.py", line 332,
in __init__
    self.vm_list = collect_vms()
  File "/usr/lib/python2.2/site-packages/java_config/jc_options.py", line 317,
in collect_vms
    if os.path.isdir(cfg['JAVA_HOME']):
KeyError: JAVA_HOME

bash-2.05b# emerge -p java-config
 
These are the packages that I would merge, in order:
 
Calculating dependencies ...done!
[ebuild   R   ] dev-java/java-config-1.1.1


Reproducible: Always
Steps to Reproduce:
1.
2.
3.




bash-2.05b# emerge --info
Portage 2.0.49-r15 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r8, 2.4.19-crypto-r7)
=================================================================
System uname: 2.4.19-crypto-r7 i686 AMD Duron(tm) Processor
Gentoo Base System version 1.4.3.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=i686 -Os -fno-strict-aliasing -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT=""
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=i686 -Os -fno-strict-aliasing -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages/Hosts/olly"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 alsa apm avi bonobo crypt cups dvd encode gif gnome gtk gtk2 java jpeg
mad mmx mpeg nas oggvorbis oss pam pdflib pcmcia png quicktime readline samba
sdl spell sse ssl tiff truetype wmf X zlib"
Comment 1 george 2003-10-31 08:57:20 UTC
I've gone back to stable 0.2.8 for this package and I'm working again but
if you need me to check anything then just ask.
Comment 2 Bryan Østergaard (RETIRED) gentoo-dev 2003-11-04 15:36:30 UTC
I'm pretty sure you have a file in /etc/env.d/java that doesn't define JAVA_HOME.

At least that's the only way I've been able to reproduce this bug so far.
I've gone through the relevant parts of java-config and the code looks correct
so far.

Could you check that all the /etc/env.d/java files defines JAVA_HOME?
Comment 3 Adrian Almenar 2003-11-04 18:26:02 UTC
Bryan this is what happens to me.

sirius root # cat /etc/env.d/java/20sun-jdk-1.4.2.01
VERSION="Sun JDK 1.4.2.01"
JAVA_HOME=/opt/sun-jdk-1.4.2.01
CLASSPATH=.:/opt/sun-jdk-1.4.2.01/jre/lib:/opt/sun-jdk-1.4.2.01/lib/tools.jar:/opt/sun-jdk-1.4.2.01/jre/lib/rt.jar
JDK_HOME=/opt/sun-jdk-1.4.2.01
JAVAC=${JAVA_HOME}/bin/javac
ADDPATH="${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin:${JAVA_HOME}/jre/javaws"
ADDLDPATH="/opt/sun-jdk-1.4.2.01/jre/lib"
MANPATH="/opt/sun-jdk-1.4.2.01/man"
ENV_VARS="JAVA_HOME CLASSPATH JDK_HOME JAVAC ADDPATH ADDLDPATH MANPATH"

This file is OK, now ill look at blackdown-jdk.

sirius root # cat /etc/env.d/java/20blackdown-jdk-1.4.1
VERSION="Blackdown JDK 1.4.1"
JAVA_HOME=/opt/blackdown-jdk-1.4.1
CLASSPATH=/opt/blackdown-jdk-1.4.1/jre/lib/rt.jar:.
JDK_HOME=/opt/blackdown-jdk-1.4.1
JAVAC=${JAVA_HOME}/bin/javac
ADDPATH="${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin"
ADDLDPATH="${JAVA_HOME}/jre/lib/i386/:${JAVA_HOME}/jre/lib/i386/native_threads/:${JAVA_HOME}/jre/lib/i386/classic/"
MANPATH=/opt/blackdown-jdk-1.4.1/man
ENV_VARS="JAVA_HOME CLASSPATH JDK_HOME JAVAC ADDPATH ADDLDPATH MANPATH"

Sun JDK its set as the system vm, now im going to change default JDK to blackdown:
sirius root # java-config -S blackdown-jdk-1.4.1
System VM set, you may want to regenerate /etc/profile with env-update
sirius root # env-update
>>> Regenerating /etc/ld.so.cache...
 * Caching service dependencies...                                      
                            [ ok ]
sirius root # source /etc/profile
sirius root # cat /etc/env.d/20java
# Autogenerated by java-config
# Command: --set-system-vm=blackdown-jdk-1.4.1
# VERSION="Blackdown JDK 1.4.1"
PATH="/opt/sun-jdk-1.4.2.01/bin:/opt/sun-jdk-1.4.2.01/jre/bin"
ROOTPATH="/opt/sun-jdk-1.4.2.01/bin:/opt/sun-jdk-1.4.2.01/jre/bin"
JDK_HOME=/opt/blackdown-jdk-1.4.1
JAVAC=/opt/sun-jdk-1.4.2.01/bin/javac
MANPATH=/opt/blackdown-jdk-1.4.1/man
JAVA_HOME=/opt/blackdown-jdk-1.4.1
CLASSPATH=/opt/blackdown-jdk-1.4.1/jre/lib/rt.jar:.
LDPATH="/opt/sun-jdk-1.4.2.01/jre/lib/i386/:/opt/sun-jdk-1.4.2.01/jre/lib/i386/native_threads/:/opt/sun-jdk-1.4.2.01/jre/lib/i386/classic/"

I still have some path's setted to sun-jdk but i changed it to blackdown.

LDPATH variable gets created getting the ADDLDPATH.variable.
ROOTPATH and PATH variables get created getting the ADDPATH variable.

so the bug is somewhere where the config reads /etc/env.d/java/20* file and
where its says ${JAVA_HOME} it doesnt get updated also on LDPATH doesnt get
well rewritten.

Hope this can help you a little more.
Comment 4 Adrian Almenar 2003-11-04 20:45:04 UTC
sorry wrong bug, dont take my last comment
Comment 5 Jason A. Mobarak (RETIRED) gentoo-dev 2003-11-04 21:07:19 UTC
Small fix in CVS, but cfg dictionary should be checking to make sure all
fields java-config expects to be there are there... will close bug after
I fix that.
Comment 6 george 2003-11-05 01:26:29 UTC
In /etc/env.d/java I have:

20blackdown-[jdk|jre]-1.4.1 both of which have JAVA_HOME looking good,

I also have tmp - a zero length file.  Could this cause the problem?  At
least it's easy to test ;)

I had a quick look at the timestamp for tmp and compared it with emerge.log
but it doesn't look too helpful.  Apparently I was emerging realone at that
time and a check in the package db CONTENTS file has nothing anywhere near.

If it is this file, then next time I start a clean build, I'll try and find
where it comes from.
Comment 7 Bryan Østergaard (RETIRED) gentoo-dev 2003-11-05 19:01:33 UTC
Yes, a zero lenght file would cause this trouble. Btw, I just emerged 1.1.2
and it doesn't seem to fix the problem.
Comment 8 george 2003-11-06 07:35:24 UTC
Deleted the zero length file and the problem goes away.

I see exactly the same results with 1.1.2 as with 1.1.1 - I tested with both.

I would suggest java-config should cope with bad files, ignore them and warn.
Comment 9 Jason A. Mobarak (RETIRED) gentoo-dev 2003-11-07 00:12:18 UTC
I've tried this with a zero length file and java-config 1.1.3 the problem
doesn't seem to be there, if the problem still persists when 1.1.3 is released
please post the traceback.
Comment 10 Jason A. Mobarak (RETIRED) gentoo-dev 2003-11-07 00:18:59 UTC
@discord jc --> tail /etc/env.d/java/20blackdown-j*
==> /etc/env.d/java/20blackdown-j00 <==
 
==> /etc/env.d/java/20blackdown-jdk-1.4.1 <==
 
VERSION="Blackdown JDK 1.4.1"
JAVA_HOME=/opt/blackdown-jdk-1.4.1
CLASSPATH=/opt/blackdown-jdk-1.4.1/jre/lib/rt.jar:.
JDK_HOME=/opt/blackdown-jdk-1.4.1
JAVAC=${JAVA_HOME}/bin/javac
ADDPATH="${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin"
ADDLDPATH="/opt/blackdown-jdk-1.4.1/jre/lib/i386/:/opt/blackdown-jdk-1.4.1/jre/lib/i386/native_threads/"
MANPATH=/opt/blackdown-jdk-1.4.1/man
ENV_VARS="JAVA_HOME CLASSPATH JDK_HOME JAVAC ADDPATH ADDLDPATH MANPATH"
 
==> /etc/env.d/java/20blackdown-jre-1.4.1 <==
# $Header:
/home/cvsroot/gentoo-x86/dev-java/blackdown-jre/files/blackdown-jre-1.4.1,v
1.1 2003/02/18 19:28:15 cretin Exp $
 
VERSION="Blackdown JRE 1.4.1"
JAVA_HOME=/opt/blackdown-jre-1.4.1
CLASSPATH=/opt/blackdown-jre-1.4.1/lib/rt.jar
JRE_HOME=/opt/blackdown-jre-1.4.1
ADDPATH="${JAVA_HOME}/bin"
ADDLDPATH="/opt/blackdown-jre-1.4.1/lib//:/opt/blackdown-jre-1.4.1/lib//server/"
MANPATH=/opt/blackdown-jre-1.4.1/man
ENV_VARS="JAVA_HOME CLASSPATH JRE_HOME ADDPATH ADDLDPATH MANPATH"
@discord jc --> ./java-config -L
Cannot find JAVA_HOME in config file /etc/env.d/java/20blackdown-j00
[blackdown-jre-1.4.1] "Blackdown JRE 1.4.1" (/etc/env.d/java/20blackdown-jre-1.4.1)
[blackdown-jdk-1.4.1] "Blackdown JDK 1.4.1" (/etc/env.d/java/20blackdown-jdk-1.4.1)
*
Comment 11 Bryan Østergaard (RETIRED) gentoo-dev 2003-11-08 07:15:01 UTC
java-config 1.1.4 solves this for me at least.

George, could you see if 1.1.4 solves it for you too?
Comment 12 george 2003-11-08 08:33:08 UTC
Yes, 1.1.4 does it for me too.

Good, and quick, job guys.  Thanks.
Comment 13 Adrian Almenar 2003-11-08 08:49:14 UTC
Closing it.