When the CLASSPATH, JAVA_HOME and JAVAC variables are missing in the environment java-config -p produces a Python stacktrace. The aforementioned variables can be unset by the user, or not set at all when in a non-interactive shell (default behaviour by bash and tcsh is not to source any scripts for non-interactive shells). Together with Stefan Manegold, I figured out that the Ant wrapper script calls `java-config -p`, which then results in: (pegasus:~) fabian% ssh pegatoo "tcsh -c ant" Traceback (most recent call last): File "/usr/bin/java-config", line 123, in ? run(option_list) File "/usr/bin/java-config", line 41, in run func(args) File "/usr/lib/python2.4/site-packages/java_config/jc_options.py", line 337, in __call__ print env['CLASSPATH'] File "/usr/lib/python2.4/UserDict.py", line 17, in __getitem__ def __getitem__(self, key): return self.data[key] KeyError: 'CLASSPATH' Buildfile: build.xml does not exist! Build failed The error itself is reproducable in many ways, simplest to just unset CLASSPATH, JAVA_HOME and JAVAC and then running java-config -p. I did an attempt to fix this by catching the KeyError and printing an empty line instead. See my attached patch.
Created attachment 76237 [details, diff] patch for jc_options.py small "fix" which at least silences jc_options.py when CLASSPATH is not set
any news/comment on this?
the patch works for me - instead of printing nothing, I recommend printing an error message ie 'CLASSPATH not set' Due to java changeover, the error is now caused by java-config-1 -p. This bug does not exist with v2
So, for java-config-1 -p, -p is generally expecting the name of a package to get the classpath for. So, I think there's another bug at work which would cause ant to not pass anything to java-config-1. So, for now, the patch should suffice.
Fixed in 1.3.5, which should be hitting your local mirrors in the very near future.