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

    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 Inventory.java file by typing

    Java Code:
    javac -classpath $HOME/Java/Lab4 Inventory.java
    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
    Thanks.

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

    Default

    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, 08:10 AM
  2. Replies: 2
    Last Post: 08-01-2007, 06:26 AM
  3. Replies: 1
    Last Post: 07-31-2007, 02:54 PM
  4. Replies: 1
    Last Post: 07-25-2007, 11:55 PM
  5. Replies: 1
    Last Post: 07-16-2007, 07: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
  •