Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Error running Java programs

  • 13-04-2004 01: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, Registered Users 2 Posts: 3,548 ✭✭✭Draupnir


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


  • Registered Users, Registered Users 2 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, Registered Users 2, Paid Member Posts: 2,032 ✭✭✭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