• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

javac -source 1.5 -target 1.5 myfile.java question

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
They worship nothing. They say it's because nothing lasts forever. Like this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic