Community
Participate
Working Groups
Build 20020612 F3 It appears that the command line compiler ignores the CLASSPATH environment variable. Could be improved
Post 2.0
Reopening
Clearing resolution
Please investigate
There is no perfect way to get the CLASSPATH environment variable. The best we could do is to use a specific property name for that and then invoke the batch compiler with the -D option. Something like: java -Denv.classpath=%CLASSPATH% ...... And in our code we could check if the property "env.classpath" is set or not. Does this sound acceptable?
It seems that the property java.class.path is set to the value of the classpath environment variable. So if no classpath is specified, this should be the value to use or '.' if none. If a classpath is specified, it override the existing classpath environment variable.
The final approach is to add a new option -bootclasspath, which reprensents the system classes. The -classpath is now converted to the user classpath. So there is no need anymore to specify the rt.jar in the classpath in order to compile a class. The batch compiler uses a heuristic to retrieve the system libraries of the JVM used to run it. I will attach a patch. This is not officially supported yet. It won't be till this PR is closed.
Created attachment 1783 [details] Patch to support a new option -bootclasspath
Fixed and released in 2.1 stream.
Verified.