+ Reply to Thread
Results 1 to 4 of 4

Thread: JRE trouble

  1. #1
    ichwar's Avatar
    ichwar is offline Community Advocate ichwar is an unknown quantity at this point
    Join Date
    Dec 2008
    Location
    NC, USA
    Posts
    1,454

    JRE trouble

    So for some reason, my java runtime environment isn't working. For reference, I'm using ubuntu 9.04 64-bit. For a while it was working just fine, and then all of a sudden a couple of days ago, I tried to run a .class I had just compiled and I got this error:
    Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: EmployeeTest/java
    Caused by: java.lang.ClassNotFoundException: EmployeeTest.java
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    Could not find the main class: EmployeeTest.java.  Program will exit.
    I tried removing jre, then reinstalling it, but still the problem persists. Has anyone had this problem? Does anyone know how to fix this?
    Thanks.

  2. #2
    adam.k is offline x10Hosting Member adam.k is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    35

    Re: JRE trouble

    It looks like it can't find a class or something within the class file. Of course I could be totally wrong, have you recently updated your JRE?
    Last edited by adam.k; 07-17-2009 at 02:12 PM. Reason: Addition to sentence.

  3. #3
    ichwar's Avatar
    ichwar is offline Community Advocate ichwar is an unknown quantity at this point
    Join Date
    Dec 2008
    Location
    NC, USA
    Posts
    1,454

    Re: JRE trouble

    You're very close. I actually just got this problem resolved on another forum. Thanks for the help though.

    My problem was that I was the .class extension on the end of the filename. eg. I was typing
    java EmployeeTest.class
    when the correct syntax is
    java EmployeeTest
    and java will automatically sort out the .class files itself.

    Well, I guess a mod can lock or remove this thread now.

  4. #4
    nirajkum is offline x10 Sophmore nirajkum is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    161

    Re: JRE trouble

    Set the class path to EmployeeTest.class file its the classpath problem ...

+ Reply to Thread

Similar Threads

  1. Trouble Linking Accounts
    By Bur7ama in forum Free Hosting
    Replies: 1
    Last Post: 02-12-2009, 03:56 PM
  2. login and hosting trouble
    By osshm in forum Free Hosting
    Replies: 9
    Last Post: 11-04-2007, 09:52 AM
  3. Having trouble accessing site.
    By kephryn in forum Free Hosting
    Replies: 2
    Last Post: 10-14-2007, 03:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers