It's not a secret anymore!
The moose likes Beginning Java and the fly likes what is target option for compilation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is target option for compilation" Watch "what is target option for compilation" New topic

what is target option for compilation

mark stone
Ranch Hand

Joined: Dec 18, 2001
Posts: 417
what is the target option like say
javac -target 1.2
first is the syntax ok. assuming say i have jdk version 1.3 (say) then the above would compile my file with respect to 1.2 version.
is that ok ?
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
You may find all the information you need at javac - Java programming language compiler
Moving this to Java in General (Beginner)
[ August 29, 2002: Message edited by: Valentin Crettaz ]

[Blog] [Blogroll] [My Reviews] My Linked In
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Your syntax is correct and you would seem to understand what it does correctly. If I recall correctly, the Java 2 SDK 1.3 by default compiles for 1.2.
Note that this only (potentially) changes the format of the class file. If you've specified newer API class files for use with your program, then it still won't work on an older JVM that doesn't have access to these newer API class files.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: what is target option for compilation
jQuery in Action, 3rd edition