Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8003350

javac -target does not work without -source

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 7
    • tools
    • None
    • 7

      Create simple Test.java
      public class Test {
        public static void main(String[] args) {
        }
      }

      Have JDK 7 installed
      try javac -target 1.6 Test.java
      FAIL: javac: target release 1.6 conflicts with default source release 1.7

      try javac -target 1.6 -source 1.6 Test.java
      Success.

      The same when you try to use -target 1.5 or -target 1.4.2

            Unassigned Unassigned
            alioffe Alexander Ioffe (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: