Menu

#354 Fatal error: Unable to find package java.lang in classpath or bootclasspath

v1.0 (example)
open
nobody
None
5
2020-07-21
2019-09-11
Tim Harris
No

I am a student learning about coding for my degree with little to no previous experience, and am admittedly very overwhelmed and confused. I am working on an assignment, and keep receiving the following fatal error: "Fatal Error: Unable to find package java.lang in classpath or bootclasspath " This occurs after I compile, and the compiler says everything compiled successfully, but when I attempt to run it, it says the interaction pane isn't in sync and I need to recompile. Further, if I look at the console, I see the above fatal error. I am completely at a loss as to how to resolve it. I'd appreciate any help I can get.

DrJava Version : drjava-20190813-220051
DrJava Build Time: 20190813-220051

DrJava Configuration File: /Users/timothyharris/.drjava

I have downloaded and installed JDK12.

Thanks in advance.

Related

Support Requests: #354

Discussion

  • Kevin R. Bulgrien

    I have read somewhere that JDK 1.8 was needed, but I do not remember where. Perhaps it meant minimum? In any event, and realizing that my similar issue was on Linux, you still might go see my comments at Support requests #360/#359 presuming moderators accept them. In my response I detail that in one case, I had to go to Preferences and set the tools.jar location by browsing to it... not just by pasting in the path. I struggled with the symptoms you describe too. In the end, all I had to do was point DrJava to the tools.jar, whether by the preferences, or making sure it was actually installed.

    I think this is where I saw someone fixed an issue by using 1.8:

    https://stackoverflow.com/questions/57717862/how-to-resolve-unable-to-find-package-java-lang-in-classpath-or-bootclasspath

     

    Last edit: Kevin R. Bulgrien 2020-05-30
  • Robert Cartwright

    DrJava only works with Java JDK 8 which is available for all major laptop
    platforms at https://aws.amazon.com/corretto/ (Amazon Corretto) by clicking
    on the "Amazon Corretto 8" button. You should uninstall JDK12 (from
    Oracle?) first.

    Sometime within the next year, I hope to release a version of DrJava that
    works for Java JDK 9+. Starting with JDK 9, Oracle broke backward
    compatibility for Java apps that use any of the the "lib" files in the JDK
    distribution. Eclipse and IntelliJ have massive staffs funded by paid
    license revenue or corporate sponsorship, enabling those environments to
    support Java 9 and its sucessors as soon as they were released.. DrJava is
    nearly 20 years old. In the early days, it was partially supported by
    grants from the National Science Foundation, the State of Texas, and Sun
    Microsystems and it kept abreast of the latest technology including`support
    for generic types (as in Java 5) and integrated unit testing (using JUnit)
    from its inception in 2001. But now the only support for DrJava is a small
    fraction of my (donated) time. For a beginning programmer, the differences
    between Java 8 and Java 12 are insignificant, but the Java 12 distribution
    (most importantly library files) is inconsistent with the Java 8
    distribution. Amazon still supports Java 8 because many applications like
    DrJava still rely on that environment. In the progression from Java 1 to
    Java 8, each new version of Java augmented the previous one but supported a
    high level of backward compatibility. (I have not tried it, but I think
    all of the older versions of DrJava will run on Java JDK 8. I am not aware
    of any incompatibilities.) In contrast, none of the released versions of
    DrJava released since 2001 will run on Java JDK 9, 10, 11, 12, 13, 14, ...

    Roll back to Java JDK 8 and enjoy ...

    Best,

    Corky

    On Tue, Sep 10, 2019 at 11:08 PM Tim Harris allidoiswin@users.sourceforge.net wrote:


    Status: open
    Group: v1.0 (example)
    Created: Wed Sep 11, 2019 04:08 AM UTC by Tim Harris
    Last Updated: Wed Sep 11, 2019 04:08 AM UTC
    Owner: nobody

    I am a student learning about coding for my degree with little to no
    previous experience, and am admittedly very overwhelmed and confused. I am
    working on an assignment, and keep receiving the following fatal error:
    "Fatal Error: Unable to find package java.lang in classpath or
    bootclasspath " This occurs after I compile, and the compiler says
    everything compiled successfully, but when I attempt to run it, it says the
    interaction pane isn't in sync and I need to recompile. Further, if I look
    at the console, I see the above fatal error. I am completely at a loss as
    to how to resolve it. I'd appreciate any help I can get.

    DrJava Version : drjava-20190813-220051
    DrJava Build Time: 20190813-220051

    DrJava Configuration File: /Users/timothyharris/.drjava

    I have downloaded and installed JDK12.

    Thanks in advance.

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

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

     

    Related

    Support Requests: #354

    • Javier Silva

      Javier Silva - 2020-07-21

      Muchas gracias Robert, a mi me funciono muy bien tu solución.

      Buena tarde!!!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.