-
Bug
-
Resolution: Unresolved
-
P3
-
None
-
6
-
generic
-
generic
It has been reported that Filer.createResource will ignore the relative directory unless an explicit -d option is used:
http://forum.java.sun.com/thread.jspa?threadID=5240999
My annotation processor tries to create an output file called META-INF/persistence.xml in the classes output directory (i.e. -d option to javac). So, I wrote following code:
final FileObject fo = processingEnv.getFiler().createResource(
StandardLocation.CLASS_OUTPUT, // -d option to javac
"",
"META-INF/persistence.xml",
null);
This works as long as I pass -d option to javac. e.g., if I invoke:
javac -d . Foo.java
it creates ./META-INF/persistence.xml. But, if I invoke
javac Foo.java
it creates ./persistence.xml; where is my META-INF directory gone?
Sahoo
http://forum.java.sun.com/thread.jspa?threadID=5240999
My annotation processor tries to create an output file called META-INF/persistence.xml in the classes output directory (i.e. -d option to javac). So, I wrote following code:
final FileObject fo = processingEnv.getFiler().createResource(
StandardLocation.CLASS_OUTPUT, // -d option to javac
"",
"META-INF/persistence.xml",
null);
This works as long as I pass -d option to javac. e.g., if I invoke:
javac -d . Foo.java
it creates ./META-INF/persistence.xml. But, if I invoke
javac Foo.java
it creates ./persistence.xml; where is my META-INF directory gone?
Sahoo
- relates to
-
JDK-6647998 NPE from Filer.getResource when sourcepath is not explicitly set
-
- Open
-