Skip to main content

javac target warning

4 replies [Last post]
smiley
Offline
Joined: 2003-06-23
Points: 0

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.
brucechapman
Offline
Joined: 2004-03-18
Points: 0

Done.

Here are some of the options in javac

-bootclasspath
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]

rreyelts
Offline
Joined: 2003-06-10
Points: 0

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

jwenting
Offline
Joined: 2003-12-02
Points: 0

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.

rreyelts
Offline
Joined: 2003-06-10
Points: 0

> that was not the question.

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

Thanks and God bless,
-Toby Reyelts