Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Question about javac -source -target

795530Jan 23 2014 — edited Jan 24 2014

Hello:

I am using JDK 1.8.0-ea and I want to compile my sources for 1.7 (compatibility with previous VM: 1.7 is the latest official release)

C:\Users\admin>javac -target 1.7 prg.java

javac: target release 1.7 conflicts with default source release 1.8

C:\Users\admin>javac -source 1.8 -target 1.7 prg.java

javac: source release 1.8 requires target release 1.8

Is there some way I could compile for previous VM or will 1.8 classes NOT be compatible  with previous VMs?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 21 2014
Added on Jan 23 2014
6 comments
6,349 views