• Post Reply Bookmark Topic Watch Topic
  • New Topic

-source 1.5...6...nothing?  RSS feed

 
Leroy J Brown
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm currently working through Just Java 2 6th edition which was put out with 1.5 as the last java release and the author keeps bringing up that you should be compiling files that use version 5 features like such a ways:



but has stated before that at press time sun hadn't made up their mind whether they would maintain the necessity of that bit. Using Eclipse I don't launch or compile from the command line. Is this necessary or did sun give up on it?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmmm. Well, the -source (input language version) and -target (output bytecode version) switches are defintely there, and in common use; but the JDK 1.5 compiler defaults to -source 1.5 -target 1.5; i.e., the switches aren't necessary unless you want to (for example) tell a Java 5 compiler to accept only Java 1.4 syntax and emit Java 1.4 bytecodes.

So the answer is no, it's not necessary.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!