• Post Reply Bookmark Topic Watch Topic
  • New Topic

javac -source 1.5 -target 1.5 myfile.java question  RSS feed

 
Mike Hudek
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Peter van der Linden, in his excellent book Just Java 2 6th ed, suggests that, if a program is being compiled which contains features new to JDK 1.5, the command line entry should read something like this:



As an aside, he mentions that this may change after the book has gone to press.

I could not see any indications on his website (or anywhere else) that it has changed, but, as an experiment, I was able to compile some simple programs that contained the new autoboxing and unboxing features (the context in which this issue was introduced) by simply typing



in the command line.

Am I understanding what has been said correctly, and are these extra options on the command line now redundant, or will I have difficulties implementing new JDK 1.5 features at the compile stage in the future?

Where can I find documentation on this?

Thanks for your help in advance.

Regards,

Mike
 
John Dell'Oso
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike,

Not too sure if things have changed - but according to the Sun documentation, the default version numbers for the source and target options are 1.5.

Have a look at this:

javac - Java programming language compiler

Regards,
JD
 
Mike Hudek
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks John, that's a great help.

As you have mentioned, the link you provided it stated that the options -source 1.5 and -target 1.5 are defaults so that is why they are not needed!

A very useful resource for me, that link! Thanks again!

Regards,

Mike

[ February 22, 2006: Message edited by: Mike Hudek ]
[ February 22, 2006: Message edited by: Mike Hudek ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!