Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Problem with running java from cmd line

Options
  • 05-01-2006 3:56am
    #1
    Closed Accounts Posts: 201 ✭✭


    I have a problem with running the following command from command line in windows "java <java class file name> "
    I navigate to the directory where the class file is located in cmd line and then try to execute it and it gives

    Exception in thread "main" java.lang.NoClassDefFoundError: <java class file name>

    even though the .class file is right there in the directory that i am executing the java command from
    Any ideas???
    Is it something to do with setting the classpath ??


Comments

  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    type in

    set classpath=%CLASSPATH%;.

    then try. Also check the file to see if it has a package name if it doesn't work.


Advertisement