Cross compilation not as documented

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8u40
    • Affects Version/s: 7
    • Component/s: docs

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      The javac technote here: http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html#crosscomp-example
      says that specifying " -source 1.6 " will produce javase6 compatible class files and specifying " -target 1.6 " is not required.

      But in practice this is not the case and omitting " -target 1.6 " will produce javase7 class files.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create ubiquitous HelloWorld.java
      2. Compile with: javac -source 1.6 HelloWorld.java
      3. Run with: /path/to/jre6/bin/java HelloWorld

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Prints " Hello, World! "
      ACTUAL -
      Exception about wrong class file vertion number.

      REPRODUCIBILITY :
      This bug can be reproduced always.

            Assignee:
            Raymond Gallardo
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: