Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Help me in Setting Classpath

    I have set two environment variables for JAVA JDK.

    1. PATH=C:\Program Files\Java\jdk1.6.0_26\bin;%PATH%

    2. CLASSPATH=C:\Program Files\Java\jdk1.6.0_26\lib\tools.jar

    When I compiled the file using javac it was done successfully but when I ran the file using java command I got the following error:

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

  • #2
    New Coder
    Join Date
    Jan 2011
    Location
    India
    Posts
    31
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Add the folder which contains the HelloWorld.class into class path

    CLASSPATH=C:\Program Files\Java\jdk1.6.0_26\lib\tools.jar;Path\to\helloworld\folder.

  • #3
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Didn't work

  • #4
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    also set the location of your compiled class files in classpath


  •  

    Posting Permissions

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