Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is target option for compilation

 
mark stone
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the target option like say
javac -target 1.2 file.java
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
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic