imagej / imagej-launcher

The ImageJ native launcher
https://imagej.net/learn/launcher
BSD 2-Clause "Simplified" License
21 stars 23 forks source link

Javac doesn't produce META-INF directory when output dir is unspecified #22

Closed hinerm closed 9 years ago

hinerm commented 9 years ago

Reported by @sinverso When compiling from the command line, e.g. via: fiji --javac *.java the annotations are written out as files matching the annotation name, whose contents are the classes with that annotation.

However, no META-INF directory is produced, and these files do not actually allow the annotations to be detected even if they are on the classpath, e.g. via fiji -cp . Main.class

On the other hand, if the compilation step specifies an ouptut directory, even if it's the current working directory, e.g. fiji --javac -d . *.java, a META-INF is created and functions properly when calling a main class as above.

dscho commented 9 years ago

I am testing with the following x1.java:

import org.scijava.plugin.Plugin;
import org.scijava.plugin.SciJavaPlugin;

@Plugin(type = SciJavaPlugin.class)
public class x1 implements SciJavaPlugin { }

and can confirm. However, I think that the culprit is more likely in scijava-common's annotation processor. This theory should be easy to confirm or refute using the --debugger=8000,suspend=y option of the launcher and attaching Eclipse to debug org.scijava.annotations.AnnotationProcessor.