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

Java Installation Problem

Options
  • 21-02-2006 7:18pm
    #1
    Registered Users Posts: 2,073 ✭✭✭


    Hey all,

    I'm trying to install the Java JDK on my home computer to save me from having to go into college.

    It installed fine but when I try to run any program i get the following error on the dos console:

    Exception in thread "main" java.lang.NoClassDefFoundError

    I have set up the system varibles under the advanced tab in my computer properties.

    The installation path I used was: C:\Java


    Any ideas?


Comments

  • Closed Accounts Posts: 1,150 ✭✭✭FreeAnd..


    Have you compiled the java class that you want to run?


  • Registered Users Posts: 29 steve04


    I know it sounds stupid, but do you have the current dir '.' in the classpath? Otherwise, preceed all files with "./"


  • Registered Users Posts: 2,073 ✭✭✭jamieh


    steve04 wrote:
    I know it sounds stupid, but do you have the current dir '.' in the classpath? Otherwise, preceed all files with "./"

    Hi Steve....Could you tell me how do I add the current dir '.' in the classpath?

    The programs compile ok.


    Under system variables I have Java_Home which is set to C:\Java

    I also have a "Path" variable which is set to:

    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft Visual Studio 8\Team Tools\Performance Tools\;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\;C:\Java\jdk\bin


  • Registered Users Posts: 29 steve04


    Firstly, find out what your classpath is set to:
    echo %CLASSPATH%
    

    if you dont see the current dir in the classpath then append it:
    set CLASSPATH=%CLASSPATH%;.
    

    good luck.

    Also, a handy way of finding the current system vars is typing "set" on its own.


  • Registered Users Posts: 2,073 ✭✭✭jamieh


    Thanks a mill....

    The current classpath is: C:\Program Files\Java\jre1.5.0_04\lib\ext\QTJava.zip

    What should I change it to??

    Cheers


  • Advertisement
  • Closed Accounts Posts: 3,285 ✭✭✭Smellyirishman


    pending....I made a whoopsie.


  • Registered Users Posts: 53 ✭✭martinoc


    Your systemwide classpath should be unset! Setting the classpath environment variable should only be done for specialised setups.


  • Registered Users Posts: 4,003 ✭✭✭rsynnott


    jamieh wrote:
    Hey all,

    I'm trying to install the Java JDK on my home computer to save me from having to go into college.

    This somehow strikes me as riotously funny.


  • Registered Users Posts: 29 steve04


    martinoc wrote:
    Your systemwide classpath should be unset! Setting the classpath environment variable should only be done for specialised setups.

    As Martinoc said, you shouldn't really have your systemwide classpath set to any value, as it may cause conflicts. Delete the value for your classpath in your environment variables. (i suspect you have iTunes/Quicktime installed as this auto-adds the QTJava.zip)

    So, your options are to either:

    - Set your session classpath in your command prompt to the current dir using:
    set CLASSPATH=%CLASSPATH%;.
    

    or,

    - use the
    -classpath
    
    swith option when running the java class e.g.
    java -classpath . HelloWorld
    
    --> where HelloWorld is your program


Advertisement