Find the answer to your Linux question:
Results 1 to 5 of 5
I'm having trouble with my class path(at least tahts what I was told, and I believe it is true). When i try to compile a project in my /home/daum/Programming and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2004
    Posts
    21

    java +netbeans+class path?


    I'm having trouble with my class path(at least tahts what I was told, and I believe it is true). When i try to compile a project in my /home/daum/Programming and other subdirectoires of Programming i get a error:
    Exception in thread "main" java.lang.NoClassDefFoundError: Examples/mytry (wrong name: mytry)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :502)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:123)
    at java.net.URLClassLoader.defineClass(URLClassLoader .java:250)
    at java.net.URLClassLoader.access$100(URLClassLoader. java:54)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 193)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:186)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 99)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:265)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 55)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:315)


    How do I tell NetBeans and java where the class path is? I want it so I can compile and run anything from Programming and all subdirectories of it.
    Thanks
    Daum

  2. #2
    Linux Guru kkubasik's Avatar
    Join Date
    Mar 2004
    Location
    Lat: 39:03:51N Lon: 77:14:37W
    Posts
    2,396
    These are all your own classes? Have you mounted the folder in whitch they are all contained in the Netbeans project?
    Avoid the Gates of Hell. Use Linux
    A Penny for your Thoughts

    Formerly Known as qub333

  3. #3
    Just Joined!
    Join Date
    Sep 2004
    Posts
    21
    those are not my classes, thats it not being able to find java i believe. because it compiles fine, just doesn't run right, and yes i have the folder mounted.
    Daum

  4. #4
    Linux Guru kkubasik's Avatar
    Join Date
    Mar 2004
    Location
    Lat: 39:03:51N Lon: 77:14:37W
    Posts
    2,396
    ok, i thought they were standard in the rt.jar, but I wanted to confirm that you werent overiding or summin, my best guess is that your JDK is a little off, try reinstalling that, or better yet, the jdk-netbeans combo and see what becomes of it.
    Avoid the Gates of Hell. Use Linux
    A Penny for your Thoughts

    Formerly Known as qub333

  5. #5
    Just Joined!
    Join Date
    Sep 2004
    Posts
    21
    I installed that, it works....except if i make a folder inside the subfolder Programming in my home directory, it will not work. Netbeans only works if I make the project folder in the home directory.


    Edit: got it fixed, the new netbeans/jdk it has makes it so you hvae to make this project/jar thingy to set the class path for all projects. thanks guys.
    Daum

Posting Permissions

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