Bug 3047 - Ant Javac task uses the execution runtime to compile (1GF0S3C)
Summary: Ant Javac task uses the execution runtime to compile (1GF0S3C)
Status: RESOLVED DUPLICATE of bug 3059
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.0   Edit
Hardware: All Windows All
: P3 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:48 EDT by Jeff McAffer CLA
Modified: 2002-05-03 14:19 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff McAffer CLA 2001-10-10 22:48:25 EDT
The Javac task (actually the DefaultCompilerAdapter) by default uses the current VM's java.home as the base
for finding the class lib to compile against.  Under java.home it expects to see lib/rt.jar or some such.  For J9 
the lib structure is different (e.g., lib/jclMax/classes.zip).  This means that users cannot compile Java code using
Ant under J9.  

NOTES:

JM (6/8/2001 4:51:53 PM)
	1) the workaround is to move/copy the requires classes.zip file up to where the Ant adapter is expecting it to be.
	This is less than optimal but works.  

	2) The better answer if for us to add the ability to take a "jre" or "jcl" property and use that (if set) to spec the 
	location of the class lib
	
	3) An alternative is to add args to javac to handle the new function.  However this would require retooling the 
	build script generator to include the required values in the javac task

	4) A futher alternative is to create another adapter specificially for J9 and then allow this value to be spec'd when 
	running the ant script.

	Of all of these, #2 seems like the most realistic and flexible.  (of course #1 can be done now by users).  

JM (6/11/2001 2:25:52 PM)
	No action now.  Should consider the options above post-June

AE (9/3/2001 5:38:02 PM)
	I assume that this PR is the result of the problem I had with the PDE.
	The assumption that the run time library is always on $java.home/lib/rt.jar is wrong.

	In org.eclipse.pde.internal.core.JDTCompilerAdapter the following is written:

		 .addExisting(new Path(null, System.getProperty("java.home") + "/lib/rt.jar"));

	this should be:

		 .addExisting(new Path(null, JavaCore.getClasspathVariable("JRE_LIB").toOSString());

	Warning: according to EG classpath variables will become scoped per Java project, and the variable value
	will have to be taken from the PDE project that is being built.

JW (10/4/01 11:50:48 AM)
	Improved configurability is a useful feature for this cycle.  [VAME Requirement]
Comment 1 DJ Houghton CLA 2001-10-24 06:42:15 EDT
PRODUCT VERSION:

120

Comment 2 Rodrigo Peretti CLA 2002-05-03 14:19:08 EDT

*** This bug has been marked as a duplicate of 3059 ***