0

I'm sorry about the obscene names, but I've written this processor.

I execute the following at the root of the project: javac -d compiled/ -verbose *.java

Which generates this log. It stops there and no bytecode is generated. I can't figure out why this is happening.

1 Answers1

0

Sorry, maybe asking the obvious but are you saying that for the .java files in the current folder, the corresponding .class files are not there in the compiled/ folder ?

Deepak
  • 3,648
  • 1
  • 22
  • 17
  • Yes, the .class files are not generated in the compiled/ folder and the javac log just ends abruptly without error. It ends displaying the AnnotationProcessor Round 1. –  Mar 10 '16 at 18:34
  • So the META-INF folder should not be in the current folder. You need to compile the classes (they will in another folder) and then copy the classes into the a new folder containing the META-INF folder and then build the jar. Then add jar to classpath when building, that should register the annotation processor with javac – Deepak Mar 10 '16 at 18:58
  • So I compile all .java files to the compiled directory, put the META-INF folder in the compiled directory and bundle everything (class files and META-INF) into a jar? –  Mar 10 '16 at 19:31
  • no compile the .java file in some folder without the META-INF folder. Then take the generated .class files and put them into a folder containing the META-INF folder. Then use the jar command to jar the folder containing .class files and the META-INF into a jar. That jar needs to be added to your classpath, when you do a build for some other java files where you will use annotation and expect annotation processing to happen – Deepak Mar 11 '16 at 06:42