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

Error running Java programs

Options
  • 13-04-2004 1:15pm
    #1
    Closed Accounts Posts: 2,951 ✭✭✭


    Everything was fine until today. Last week i installed the Java Advanced Imaging library on top of the java sdk 1.4.2 Everything ran fine for a while. Now when i try to run a program i get this error

    Exception in thread "main" java.lang.NoClassDefFoundError: hello


    Where hello was the name of the program. Ive tried it with loads of my programs and the same thing. Tried reinstalling sdk 1.4.2 but still no joy. The classpath is set to "C:\ORANT\jbin\ovc.jar" which looks strange to me, the path is set to "C:\j2sdk1.4.2_04\bin"

    Any ideas?
    Thanks


Comments

  • Registered Users Posts: 3,548 ✭✭✭Draupnir


    set the classpath to match the path, then it should work


  • Registered Users Posts: 491 ✭✭Silent Bob


    AFAIR on a windows box the current directory isn't added to the classpath. You can add to the classpath on a per-invocation basis by using the -classpath command line argument. It expects a colon separated list of paths.


  • Registered Users Posts: 1,990 ✭✭✭lynchie


    Originally posted by Silent Bob
    AFAIR on a windows box the current directory isn't added to the classpath. You can add to the classpath on a per-invocation basis by using the -classpath command line argument. It expects a colon separated list of paths.

    use a colon to separate the paths under unix, or a semicolon under windows.

    Make sure the directory where hello.class is located is on the classpath or if it is in a jar file ensure that the jar file is on the classpath.

    e.g. if hello.class is in c:\java then run it with java -classpath c:\java hello


Advertisement