Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » APT: Getting project classpath in Java 6 processors, automatic processor options
APT: Getting project classpath in Java 6 processors, automatic processor options [message #661684] Sat, 26 March 2011 04:49 Go to next message
Fabian Steeg is currently offline Fabian SteegFriend
Messages: 76
Registered: July 2009
Member
I'm trying to access the classpath of a Java project from a Java 6 anntotation processor used in that project.

I've read in the documentation that "there are no automatically provided options for processors using the Java 6 annotation processing API, because the JavaFileManager methods provide the same functionality".

I tried to get the classpath of the Java project via ToolProvider.getSystemJavaCompiler().getStandardFileManager( ).getLocation(StandardLocation.CLASS_PATH), but that contains only the org.eclipse.equinox.launcher Jar. If I use PLATFORM_CLASS_PATH it doesn't contain the project classpath entries, only the JDK. Is there some other way to get a JavaFileManager that would contain the classpath of the Java project?

I looked into the code while debugging this issue and saw that the options are all present in IdeProcessingEnvImpl#getOptions() but that those starting with "-" are discarded. This is consistent with the documentation, but I'm wondering why these options are not passed to all processors. To me it seems that would be an easy and consistent way to access them.
Re: APT: Getting project classpath in Java 6 processors, automatic processor options [message #724516 is a reply to message #661684] Mon, 12 September 2011 14:05 Go to previous messageGo to next message
Peter Simun is currently offline Peter SimunFriend
Messages: 1
Registered: September 2011
Junior Member
Fabian, did you solved this issue?

Thanks.
Peter
Re: APT: Getting project classpath in Java 6 processors, automatic processor options [message #724525 is a reply to message #724516] Mon, 12 September 2011 14:26 Go to previous message
Fabian Steeg is currently offline Fabian SteegFriend
Messages: 76
Registered: July 2009
Member
Hi Peter - not really, but I filed a bug with a proposed patch to fix this. No reaction so far though - perhaps if you CC yourself or vote for the bug we could show that it would make some people very happy if this was fixed Smile

https://bugs.eclipse.org/bugs/show_bug.cgi?id=341298
Previous Topic:How do I specify the URL that <F11> uses to launch my servlet under Tomcat?
Next Topic:Call View
Goto Forum:
  


Current Time: Thu Feb 06 13:59:46 GMT 2025

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

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

Back to the top