Results 1 to 4 of 4
  1. #1
    miko5054 is offline Member
    Join Date
    Mar 2010
    Posts
    50
    Rep Power
    0

    Default classpath in linux...

    i cant run any program im receiving for everything
    Java Code:
     Exception in thread "main" java.lang.NoClassDefFoundError: bank/aaa
    Caused by: java.lang.ClassNotFoundException: bank.aaa
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    Could not find the main class: bank.aaa. Program will exit.
    im guessing that is class-path issue but which path i need to set, to were???

    im using ubuntu and eclipse ...

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    java -cp<classpaths> <main-class>

    You shouldn't be setting any system paths.

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,883
    Rep Power
    25

    Default

    What does your command line look like?
    What folder are you in when you issue the java command?
    Go to the bank folder and issue:
    java bank.aaa

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    Oh yes, good point.
    Missed that it was "main" it couldn't find.
    I knew I shouldn't browse the forums in the evening!

Similar Threads

  1. Replies: 6
    Last Post: 04-08-2009, 05:05 AM
  2. Classpath
    By JavaJunkie in forum New To Java
    Replies: 1
    Last Post: 04-07-2009, 08:17 AM
  3. Replies: 2
    Last Post: 04-02-2009, 08:16 AM
  4. Classpath
    By dawiz001 in forum New To Java
    Replies: 3
    Last Post: 03-18-2009, 03:18 PM
  5. GNU Classpath 0.96
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 10-16-2007, 07:35 PM

Posting Permissions

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