Skip to main content

javac target warning

4 replies [Last post]
Joined: 2003-06-23

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).

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-03-18


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]

Joined: 2003-06-10

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.

God bless,
-Toby Reyelts

Joined: 2003-12-02

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.

Joined: 2003-06-10

> that was not the question.

I understand that. I am indeed asking a different question.

Thanks and God bless,
-Toby Reyelts