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

Cross compilation not as documented

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8u40
    • 7
    • docs

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              rgallard Raymond Gallardo
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: