Javac should have an option to check the API when using the -target switch. For instance, if I'm compiling for target 1.4, I'd like to see if I'm using any 1.5 API's in my code (right now target just checks language features).
Here are some of the options in javac
Override location of bootstrap class files
-extdirs Override location of installed extensions
-endorseddirs Override location of endorsed standards path
yes, javac will use the current versions libraries but [b] only if you don't over-ride them[/b]
Have you tried using -bootclasspath and pointing it to a 1.4 installation while using -target 1.5? Does code that uses the new language features continue to compile correctly? Most of them depend heavily on the new additions to the runtime.
that was not the question.
The OP wanted the compiler to notify him when using 1.5-only features when supplying a target classfile format of 1.4.
That's already the case as the compile will simply fail.
> that was not the question.
I understand that. I am indeed asking a different question.
Thanks and God bless,
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.