Results 1 to 2 of 2
  1. #1
    baltimore is offline Member
    Join Date
    Jul 2007
    Rep Power

    Default Exception in thread "main" java.lang.NoClassDefFoundError

    Hi, for my class lab assignment I had to copy files from one directory and put them in my /Java/Lab4/inventory/ directory, I can compile my file by typing

    Java Code:
    javac -classpath $HOME/Java/Lab4
    that then creates Inventory.class file in that same directory... and i want to run it; that's where the problem is; to run it I'm typing

    Java Code:
    java -classpath $HOME/Java/Lab4 Inventory.class
    I've also tried
    java Inventory.class

    The error I'm getting is

    Java Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: /users/klepeis/Java/Lab4

  2. #2
    brianhks is offline Senior Member
    Join Date
    Jul 2007
    Rep Power


    When running the class don't include the .class like so
    Java Code:
    java -classpath $HOME/Java/Lab4 Inventory

Similar Threads

  1. Replies: 1
    Last Post: 08-07-2007, 07:10 AM
  2. Replies: 2
    Last Post: 08-01-2007, 05:26 AM
  3. Replies: 1
    Last Post: 07-31-2007, 01:54 PM
  4. Replies: 1
    Last Post: 07-25-2007, 10:55 PM
  5. Replies: 1
    Last Post: 07-16-2007, 06:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts