Skip to main content


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 11:57 Go to next message
Marcel Austenfeld is currently offline Marcel AustenfeldFriend
Messages: 160
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 11:35 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam KandulaFriend
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 15:08 Go to previous messageGo to next message
Marcel Austenfeld is currently offline Marcel AustenfeldFriend
Messages: 160
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 15:10]

Report message to a moderator

Re: Eclipse Compiler Classpath Ignored [message #758490 is a reply to message #755781] Wed, 23 November 2011 12:50 Go to previous message
Marcel Austenfeld is currently offline Marcel AustenfeldFriend
Messages: 160
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: Fri Apr 19 19:56:47 GMT 2024

Powered by FUDForum. Page generated in 0.02878 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top