#303 DrJava won't recognize the Java 7 compiler (stuck on Java 6)

v1.0 (example)
closed
None
5
2014-08-28
2013-08-10
No

THE ISSUE: My system (including Terminal) uses Java 7u25, but DrJava is stuck on Java 6u43.

WHAT I'VE TRIED: I can't find a tools.jar file on my computer anywhere, so trying to change the path for that didn't help. I posted about this issue on stackexchange (no answers) a few days ago, and it has screenshots: http://stackoverflow.com/questions/18069708/i-cant-manage-to-get-drjava-to-update-to-java-se-7.

SYSTEM PROPERTIES: I'm running a Mac, with OS X (10.7.5) installed.

DrJava Version : drjava-20120818-r5686
DrJava Build Time: 20120818-0422

DrJava Configuration File: /Users/chrismiddleton/.drjava

Java System Properties:

apple.awt.graphics.UseOpenGL false
apple.awt.graphics.UseQuartz false
apple.laf.useScreenMenuBar true
awt.nativeDoubleBuffering true
awt.toolkit apple.awt.CToolkit
drjava.debug.port 49604
file.encoding MacRoman
file.encoding.pkg sun.io
file.separator /
ftp.nonProxyHosts local|.local|169.254/16|.169.254/16
gopherProxySet false
http.nonProxyHosts local|.local|169.254/16|.169.254/16
java.awt.graphicsenv apple.awt.CGraphicsEnvironment
java.awt.printerjob apple.awt.CPrinterJob
java.class.path /Applications/DrJava.app/Contents/Resources/Java/drjava.jar
java.class.version 50.0
java.endorsed.dirs /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/endorsed
java.ext.dirs /Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext
java.home /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
java.io.tmpdir /var/folders/4c/82dqzw0x67qfh8dvjl5xt0140000gn/T/
java.library.path /Applications/DrJava.app/Contents/Resources/Java:/System/Library/PrivateFrameworks/JavaApplicationLauncher.framework/Resources:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
java.rmi.server.hostname 127.0.0.1
java.runtime.name Java(TM) SE Runtime Environment
java.runtime.version 1.6.0_43-b01-447-11M4203
java.specification.name Java Platform API Specification
java.specification.vendor Sun Microsystems Inc.
java.specification.version 1.6
java.vendor Apple Inc.
java.vendor.url http://www.apple.com/
java.vendor.url.bug http://bugreport.apple.com/
java.version 1.6.0_43
java.vm.info mixed mode
java.vm.name Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name Java Virtual Machine Specification
java.vm.specification.vendor Sun Microsystems Inc.
java.vm.specification.version 1.0
java.vm.vendor Apple Inc.
java.vm.version 20.14-b01-447
line.separator

mrj.build 11M4203
mrj.version 1070.1.6.0_43-447
os.arch x86_64
os.name Mac OS X
os.version 10.7.5
path.separator :
socksNonProxyHosts local|.local|169.254/16|.169.254/16
sun.arch.data.model 64
sun.awt.exception.handler apple.awt.CToolkit$EventQueueExceptionHandler
sun.boot.class.path /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsfd.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Resources/Java/JavaRuntimeSupport.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/laf.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/sunrsasign.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar
sun.boot.library.path /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries
sun.cpu.endian little
sun.cpu.isalist
sun.io.unicode.encoding UnicodeLittle
sun.java.command edu.rice.cs.drjava.DrJavaRoot
sun.java.launcher SUN_STANDARD
sun.jnu.encoding MacRoman
sun.management.compiler HotSpot 64-Bit Tiered Compilers
sun.os.patch.level unknown
user.country US
user.dir /Applications
user.home /Users/chrismiddleton
user.language en
user.name chrismiddleton
user.timezone America/New_York

Related

Support Requests: #303

Discussion

  • Robert Cartwright

    Hi Chris,

    What version of DrJava are you using? Only the latest stable release
    (drjava-stable-20120818-r5686), which you can download from drjava.org, recognizes the Java 7 compiler.

    DrJava invokes Java compilers programmatically (by executing a method call)
    and it only recognizes compilers that it can confirm are compatible with
    the version of Java that is executing the DrJava IDE. Versions of DrJava
    prior to the latest stable release were released before Java 7 and will not
    load the Java 7 compiler either because they do not find it or if they do
    find it and determine that it is not compatible with the latest Java
    release that existed at the time that version of DrJava was released.

    DrJava loads and executes the classes that are compiled from DrJava (as
    well as extant class files). This process will fail (generating an error
    message) for class files that are compiled by a newer version of Java than
    the executing JVM. Java is backward compatible (legacy class files
    generally work on newer JVMs) but not the opposite. Newer version class
    files have been compiled on the basis of a newer (expanded) version of the
    Java core libraries, which is not available in the executing JVM (wihch has
    an older version of the core libraries built-in).

    If your version of DrJava is up-to-date, then I am stumped and I will have
    find a former DrJava developer with a Mac who is willing to help. I
    stopped using Macs several years ago when Apple abandoned support of Java
    on 32 bit Macs. (After several years, support resumed, presumably through
    Oracle who now develops the Mac JDK distributions, but it was too late to
    persuade to go back to using Macs.)

    Best,

    Robert "Corky" Cartwright

     
  • Robert Cartwright

    Hi Chris,

    I just read your support request more carefully and noticed that you in fact documented that you are using the latest version of DrJava. I am mystified but I have not run DrJava on a Mac in several years. I will try to borrow a Mac at the office tomorrow to see if I can reproduce your problem. I did try running the latest DrJava stable release on Linux using a prerelease Java 8. It worked perfectly except that DrJava mislabeled the Java 8 compiler as a Java 7 compiler.

    What I would try if I were you is downloading the latest stable drjava.jar file, which is the form of the distribution that we use on Linux. You can execute this file from the command line (terminal) simply by changing the working directory to the directory containing the jar file and typing

    java -jar drjava-stable-20120818-r5686.jar

    You can save yourself a bit of typing by renaming

    drjava-stable-20120818-r5686.jar as drjava.jar

    Best,

    Corky

     
  • Drew McDermott

    Drew McDermott - 2013-08-17

    I'm having exactly the same problem, as far as I can tell. (On a Mac, naturally.) I tried running DrJava from the command line, and it made no difference. (There was a slight irregularity in the way it asked whether to allow internet connections, but I doubt this had any impact on its choice of compiler.)

    Oddly, it's aware of at least one item from JDK 7. The compiler-ready message is

    ready: JDK 6.0_37 from

    /Library/Java/JavaVirtualMachines/jdk1.7.0_11.jdk/Contents/Home/lib/tools.jar.

    A wild guess is that somewhere in the jar file is a .class file compiled using Jave 6, and DrJava is afraid it might call something compiled using a later version of the compiler.

    -- Drew McDermott
    Yale CS Department

     
  • Robert Cartwright

    Hi Chris and Drew,

    I apologize for taking so long to respond to your request. I had to borrow a MacBook from a friend and use it to track down the bug. In contrast to the Java culture which eschews gratuitous changes that break legacy Java applications, Oracle has made many changes in the organization of their Java distributions for the Mac compared to the organization that Apple used while Apple was explicitly supporting Java. In particular, Oracle appends the suffix ".jdk" to the root directory for their Mac OS Java JDK distributions. The DrJava code that determines the version of a compiler from a distribution's root directory name broke as a result of this change. I have attached a patched version of DrJava that works (at least on simple examples) on the borrowed Mac (running Mac OS X 10.7.5) that I am using. This version is a jar file rather than a packaged Mac App (which I will create shortly as part of a new DrJava stable release assuming that this patch works for you). To run this jar file, download it your Desktop (it should save under the name "drjava.jar"), open the Terminal (an app in the Utilities folder inside the Applications folder), and type the following two commands in the terminal

    cd Desktop
    java -jar drjava.jar

    and the invoked DrJava program should display a DrJava frame with your Java 7 compiler as the compiler selected by default (it should also find an Eclipse Java 6 compiler bundled inside the drjava.jar file and perhaps a Java 6 compiler if you have a Java 6 JDK installed on your Mac).

    Let me know if the attached drjava.jar file works for you.

    Best,

    Corky

     
  • Drew McDermott

    Drew McDermott - 2013-08-29

    [Robert Cartwright]

    Thanks for taking a look at the Mac/Java-7 bug report. Unfortunately,
    something bogus happened with your attempt to attach the jar file. In
    Thunderbird, there is a line that says there's an attachment, but
    there's no actual attachment. Can you try resending just the jar
    file?

                                             -- Drew
    
     
    • Robert Cartwright

      I am trying again to send the attachment using SourceForge. Let's see what happens. Unfortunately, I cannot guarantee that this file is identical to the one I tested on the borrowed MacBook. I left that MacBook (containing the tested drjava.jar file) in my office at Halmstad University. I reconstructed what I think is the same jar file on my regular laptop (running Linux) that I brought home with me. I will test to see if the two jar files are identical (at least equivalent) tomorrow. in the meantime, I am uploading the reconstruction.

       
  • Robert Cartwright

    Hi Drew et al,

    I attached the file using the attach mechanism provided by sourceforge
    which I have not tested. Let me try again. Alternatively, if you send me (
    corky.cartwright@gmail.com) a direct email address, I will send the
    attachment to your address.

    Best,

    Corky

    On Thu, Aug 29, 2013 at 7:41 PM, Drew McDermott airfoyle@users.sf.netwrote:

    [Robert Cartwright]

    Thanks for taking a look at the Mac/Java-7 bug report. Unfortunately,
    something bogus happened with your attempt to attach the jar file. In
    Thunderbird, there is a line that says there's an attachment, but
    there's no actual attachment. Can you try resending just the jar
    file?

                                         -- Drew
    

    Status: open
    Created: Sat Aug 10, 2013 01:40 PM UTC by Chris Middleton
    Last Updated: Thu Aug 29, 2013 02:57 PM UTC
    Owner: nobody

    THE ISSUE: My system (including Terminal) uses Java 7u25, but DrJava is
    stuck on Java 6u43.

    WHAT I'VE TRIED: I can't find a tools.jar file on my computer anywhere, so
    trying to change the path for that didn't help. I posted about this issue
    on stackexchange (no answers) a few days ago, and it has screenshots:
    http://stackoverflow.com/questions/18069708/i-cant-manage-to-get-drjava-to-update-to-java-se-7.

    SYSTEM PROPERTIES: I'm running a Mac, with OS X (10.7.5) installed.

    DrJava Version : drjava-20120818-r5686
    DrJava Build Time: 20120818-0422

    DrJava Configuration File: /Users/chrismiddleton/.drjava

    Java System Properties:

    apple.awt.graphics.UseOpenGL false
    apple.awt.graphics.UseQuartz false
    apple.laf.useScreenMenuBar true
    awt.nativeDoubleBuffering true
    awt.toolkit apple.awt.CToolkit
    drjava.debug.port 49604
    file.encoding MacRoman
    file.encoding.pkg sun.io
    file.separator /
    ftp.nonProxyHosts local|.local|169.254/16|.169.254/16
    gopherProxySet false
    http.nonProxyHosts local|.local|169.254/16|.169.254/16
    java.awt.graphicsenv apple.awt.CGraphicsEnvironment
    java.awt.printerjob apple.awt.CPrinterJob
    java.class.path /Applications/DrJava.app/Contents/Resources/Java/drjava.jar
    java.class.version 50.0
    java.endorsed.dirs
    /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/endorsed
    java.ext.dirs
    /Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext
    java.home /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
    java.io.tmpdir /var/folders/4c/82dqzw0x67qfh8dvjl5xt0140000gn/T/
    java.library.path
    /Applications/DrJava.app/Contents/Resources/Java:/System/Library/PrivateFrameworks/JavaApplicationLauncher.framework/Resources:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
    java.rmi.server.hostname 127.0.0.1
    java.runtime.name Java(TM) SE Runtime Environment
    java.runtime.version 1.6.0_43-b01-447-11M4203
    java.specification.name Java Platform API Specification
    java.specification.vendor Sun Microsystems Inc.
    java.specification.version 1.6
    java.vendor Apple Inc.
    java.vendor.url http://www.apple.com/
    java.vendor.url.bug http://bugreport.apple.com/
    java.version 1.6.0_43
    java.vm.info mixed mode
    java.vm.name Java HotSpot(TM) 64-Bit Server VM
    java.vm.specification.name Java Virtual Machine Specification
    java.vm.specification.vendor Sun Microsystems Inc.
    java.vm.specification.version 1.0
    java.vm.vendor Apple Inc.
    java.vm.version 20.14-b01-447
    line.separator

    mrj.build 11M4203
    mrj.version 1070.1.6.0_43-447
    os.arch x86_64
    os.name Mac OS X
    os.version 10.7.5
    path.separator :
    socksNonProxyHosts local|.local|169.254/16|.169.254/16
    sun.arch.data.model 64
    sun.awt.exception.handler apple.awt.CToolkit$EventQueueExceptionHandler
    sun.boot.class.path
    /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsfd.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Resources/Java/JavaRuntimeSupport.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/laf.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/sunrsasign.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar
    sun.boot.library.path
    /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries
    sun.cpu.endian little
    sun.cpu.isalist
    sun.io.unicode.encoding UnicodeLittle
    sun.java.command edu.rice.cs.drjava.DrJavaRoot
    sun.java.launcher SUN_STANDARD
    sun.jnu.encoding MacRoman
    sun.management.compiler HotSpot 64-Bit Tiered Compilers
    sun.os.patch.level unknown
    user.country US
    user.dir /Applications
    user.home /Users/chrismiddleton
    user.language en
    user.name chrismiddleton
    user.timezone America/New_York


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/drjava/support-requests/303/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Support Requests: #303

  • Drew McDermott

    Drew McDermott - 2013-08-29

    [Robert Cartwright]

    I am trying again to send the attachment using SourceForge. Let's see
    what happens. Unfortunately, I cannot guarantee that this file is
    identical to the one I tested on the borrowed MacBook. I left that
    MacBook (containing the tested drjava.jar file) in my office at
    Halmstad University. I reconstructed what I think is the same jar file
    on my regular laptop (running Linux) that I brought home with me. I
    will test to see if the two jar files are identical (at least
    equivalent) tomorrow. in the meantime, I am uploading the
    reconstruction.

    Sorry; I didn't realize I had to go to your web-based bug-report
    system to find the jar file.

    I downloaded it, and it now finds Java 7. Thanks a lot.

                                             -- Drew
    
     
  • Robert Cartwright

    Beware that if you currently can run the DrJava Mac OS X App with Java 7 that the Oracle Java 7 JDK is reportedly incompatible with the Apple Jar Launcher used in the DrJava app. For reasons I do not understand, the DrJava app worked with Java 7 before I installed a recent Java update from Apple.

    After I updated the Apple Java 6 JDK to the latest release (6.0_51), the DrJava app no longer loads the Oracle Java 7 compiler because the Apple Jar launcher used by the DrJava app does not recognize the Oracle Java 7 JDK. If you inspect "System Properties" in such a scenario, it shows that DrJava is being executed by Apple's Java 6 JVM not Oracle's Java 7 JVM. A Java 6 JVM will not load Java 7 class files including those for a Java 7 compiler. If the Oracle Java 7 JDK is installed, DrJava typically finds the Java 7 compiler but rejects it because it cannot be loaded. The jar launchers from Apple and Oracle appear completely incompatible with one another. If we subsequently bundle DrJava with the Oracle jar launcher, such an app will not work on systems where the Oracle Java 7 JDK has not been installed.

    If you want to run DrJava using an Oracle Java 7 JDK for Mac OS X and the corresponding Java 7 compiler, you should download the DrJava jar release and run DrJava from a terminal command line using the command

    drjava -jar drjava-stable-20130901-r5756.jar

    In the future, we may create a DrJava app for Mac OS X that uses the Oracle jar launcher but such an app will only work for Macs with Java 7 installed; it will not work with an Apple Java 6 JDK. Since we do not want to create two different Mac OS X apps for DrJava, we do not anticipate making this change until Java 8 is officially released, making Java 6 obsolescent.

     
  • Robert Cartwright

    • status: open --> closed
    • assigned_to: Robert Cartwright
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks