Bug 20215 - Batch compiler ignores the CLASSPATH env variable
Summary: Batch compiler ignores the CLASSPATH env variable
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-13 12:12 EDT by Philipe Mulet CLA
Modified: 2002-09-19 10:13 EDT (History)
0 users

See Also:


Attachments
Patch to support a new option -bootclasspath (11.72 KB, application/octet-stream)
2002-08-01 15:39 EDT, Olivier Thomann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2002-06-13 12:12:28 EDT
Build 20020612 F3

It appears that the command line compiler ignores the CLASSPATH environment 
variable.  

Could be improved
Comment 1 Philipe Mulet CLA 2002-06-13 12:12:41 EDT
Post 2.0
Comment 2 Philipe Mulet CLA 2002-07-25 06:59:44 EDT
Reopening
Comment 3 Philipe Mulet CLA 2002-07-25 07:01:02 EDT
Clearing resolution
Comment 4 Philipe Mulet CLA 2002-07-25 07:34:51 EDT
Please investigate
Comment 5 Olivier Thomann CLA 2002-07-25 08:38:17 EDT
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?
Comment 6 Olivier Thomann CLA 2002-07-31 10:27:17 EDT
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.
Comment 7 Olivier Thomann CLA 2002-08-01 15:38:20 EDT
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.
Comment 8 Olivier Thomann CLA 2002-08-01 15:39:06 EDT
Created attachment 1783 [details]
Patch to support a new option -bootclasspath
Comment 9 Olivier Thomann CLA 2002-09-05 13:39:54 EDT
Fixed and released in 2.1 stream.
Comment 10 David Audel CLA 2002-09-19 10:13:36 EDT
Verified.