Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Eclipse Compiler Classpath Ignored
Eclipse Compiler Classpath Ignored [message #755410] Tue, 08 November 2011 06:57 Go to next message
Marcel A. is currently offline Marcel A.
Messages: 112
Registered: July 2009
Senior Member
Hello,

i have an RCP application which uses the Compiler API to compile java source programmatically. At the moment i use the standard java compiler with the classpath from the different plugins (paths to the external libs and binarys).

Vector<String> optionList = new Vector<String>();
optionList.addElement("-classpath");
optionList.addElement(my paths);

JavacTool compiler = com.sun.tools.javac.api.JavacTool.create();
.........
compiler.getTask(out,fileManager,null,optionList, null,Collections.singleton(sf)).call();
.......
This works as expected.

However if i try to use the Eclipse compiler instead:

JavaCompiler compiler = new EclipseCompiler();
..........

compilation errors are thrown because of the missing classpath.
Is this a bug of the Eclipse compiler in combination with Compiler API or did i do something wrong?

Apropos is there another way to calculate the classpath for the compiler (API which gives me the whole classpath of the RCP application and the embedded plugins and libs)?

Thanks in advance for any hints!

Re: Eclipse Compiler Classpath Ignored [message #755719 is a reply to message #755410] Wed, 09 November 2011 06:35 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam Kandula
Messages: 444
Registered: July 2009
Senior Member
Are the classpaths (my paths) absolute?
Re: Eclipse Compiler Classpath Ignored [message #755781 is a reply to message #755719] Wed, 09 November 2011 10:08 Go to previous messageGo to next message
Marcel A. is currently offline Marcel A.
Messages: 112
Registered: July 2009
Senior Member
Yes, the classpath paths are absolute paths. They are accepted in the eclipse compiler
if i use them without the compiler API.

[Updated on: Wed, 09 November 2011 10:10]

Report message to a moderator

Re: Eclipse Compiler Classpath Ignored [message #758490 is a reply to message #755781] Wed, 23 November 2011 07:50 Go to previous message
Marcel A. is currently offline Marcel A.
Messages: 112
Registered: July 2009
Senior Member
I'm still struggling with the classpath when using the Compiler API with the Eclipse compiler. Has anybody used successful the compiler API+Eclipse compiler+classpath (as argument)?
If so are there any examples available so that i can compare the example with my config.?
Previous Topic:m2e integration on eclipse 3.7 Indigo
Next Topic:Update v3.6: "No repository found at ...": Which plugin is concerned?
Goto Forum:
  


Current Time: Tue Jul 22 23:48:15 EDT 2014

Powered by FUDForum. Page generated in 0.01980 seconds