aspose file tools*
The moose likes Beginning Java and the fly likes compiling with the -source flag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "compiling with the -source flag" Watch "compiling with the -source flag" New topic
Author

compiling with the -source flag

Joe Lemmer
Ranch Hand

Joined: Oct 24, 2008
Posts: 171
Hi there

My web server runs Java 1.5, so I'm getting an exception because I am using JDK 1.6 to compile my classes. Running two different versions of the JDK is just confusing me. I can't work out if it's even possible. I read that I can compile using the following:



Can anyone confirm for me that this will produce the same class file as if I had been compiling with the JDK 1.5? I just want to make sure that I have everything right before I try to put things up on the web again.

Thank you guys

Joe


OCPJP 85%
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38398
    
  23
Make sure not to use any "since 6" classes or methods. I suspect you actually want the -target flag. The -source flag might be useful for avoiding any "since 6" material, however.
Joe Lemmer
Ranch Hand

Joined: Oct 24, 2008
Posts: 171
Great. Thanks very much Campbell.

I've had a look on this page about compiling and you're right, I do want to use -target. Cheers for pointing that out.



Joe
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38398
    
  23
You're welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: compiling with the -source flag