javac

java -target compile


How do I compile a java program in a different version if I have 1.6 and I want it compiled in 1.5? Would it be like...

javac -target1.5 tileGen

But when I do that I get:

error: Class names, 'tileGen', are only accepted if annotation processing is exp licitly requested 1 error


Solution

  • The problem is that javac takes the name of a source file (ending in `.java) not the name of a class.

    Try

    javac -target 1.5 tileGen.java
    

    instead.