The configure script for OpenOffice (CVS sources) sets JAVAHOME to some path of its own choosing and this makes java-config fail while trying to compile OpenOffice. Is it possible to modify java-config to work around this? In this case OpenOffice is actually calling apache-ant which is calling java-config, so I'll just trying hacking apache-ant for now. But a permanent fix would be swell. Reproducible: Always Steps to Reproduce: 1.Set JAVAHOME to any arbitrary value 2.Run java-config 3. Actual Results: $java-config -L 'import site' failed; use -v for traceback Traceback (most recent call last): File "/usr/bin/java-config", line 13, in ? import sys, getopt, os ImportError: No module named getopt
I suggest we move *all* necessary env vars for java-config and java in general into /etc/env.d/java/, and let java-config source /etc/env.d/java/21java explicitly. This way, the user may set JAVA_HOME, CLASSPATH, and whatever to completely absurd values and java-config will still work.
Hell's Bells -- I just realized that I was typing JAVAHOME when I really meant PYTHONHOME. (Java-config is a python program, after all.) Even the subject of this bug report has a bug in it :o( Sorry. What I had in mind was doing exactly what you suggested, except source the proper python environment instead of the java environment -- or even both, which seems sensible. I don't know enough python to know if a python script can be made to ignore or reset environment variables, or whether java-config would need to be a shell script which sets up the right environment before calling the python program.
i see 2 options atm 1) I don't realy know python _that_ well but from what i read in the docs it should be possible to explicitly add the search path's it needs 2) make java-config a bash script that set/unset it and runs the python java-config but i don't realy like them
a better way might be start java-config with #!/usr/bin/python -E i wonder if that works the way i think it does?
*** Bug 69064 has been marked as a duplicate of this bug. ***
I was the poster of bug 69064. The fix is to change the #! line of /usr/bin/java-config to point to /usr/bin/python and *not* the first python on $PATH. The former has what it needs in its pythonpath.
having #!/usr/bin/python -E in it should fix both no?
Changing it to /usr/bin/evn python -E is the proper fix as it will ignore the environment variables. This will be fixed sometime shortly (I hope). I have already incorporated this into the "next generation" of java-config. If you can change the execution line to #! /usr/bin/env python -E and test, it would be very helpful.
The problem I see with /usr/bin/env python -E is that the script complains that it can't find the file -E. Somehow the -E isn't being passed to python properly. However /usr/bin/python -E works perfectly, even when PYTHONHOME is set to something absurd.
Hmm, thats why we test :-p. Forgot, /usr/bin/env python -E is bad form. The reason for that is that the use of /usr/bin/env with multiple parameters is bad as the results are somewhat random as it can be interpreted differently on different systems. I would have to agree that /usr/bin/python may be the best choice in light of that.
Because java-config requires a package that is only installed in /usr/bin/python, then it should not use "#! /usr/bin/env python". It must use "#! /usr/bin/python" What's the state of this bug? java-config really really needs to be fixed, and the fix is trivial!
We are currently working on a new java-config which will address all of the current issues with java-config. This issue has already been resolved in the new version, however, the new version is still not ready for production yet.
This is not the only item that's failing during the OpenOffice compile. ---output--- /ooo/ooo_SRC680_m103_src> java-config -L [sun-jdk-1.4.2.08] "Sun JDK 1.4.2.08" (/etc/env.d/java/20sun-jdk-1.4.2.08) * /ooo/ooo_SRC680_m103_src> source ./LinuxIntelEnv.Set /ooo/ooo_SRC680_m103_src> java-config -L Traceback (most recent call last): File "/usr/bin/java-config", line 14, in ? from java_config import jc_options ImportError: No module named java_config ---output--- This is blocking http://eo.openoffice.org as we do our development on the gentoo project.
Joey, a work around is to edit your /usr/bin/java-config script so that the first line says: #!/usr/bin/python I've done this on all my Gentoo boxes until the new java-config lands.
Just wanted to add, that we really need this fixed for OOo 2.0, so any timeline for a fix or the new version going in portage?
java-config-ng is probably month away
made a revision bump that simply applies -#!/usr/bin/env python +#!/usr/bin/python -E to not hold anyone up any longer while be fix the rest of java-config
@axxo: thanks, works here :)
This has been fixed in portage with java-config-1.2.11-r1.