HELP!! problem with java installation

Discussion in 'Java' started by paul_fraser2005@yahoo.co.uk, May 7, 2005.

  1. Guest

    I am on windows XP and i can't even run hello world.

    I've set up the classpath alright (see below) but when I run a program
    it doesn't recognise the classname (see below).

    I've tried uninstalling/re-installing java with the same result.

    I'm running java 1.4.2_05

    C:\>type hello.java
    public class hello {

    public static void main(String[] args)
    {
    System.out.println("hello world");
    System.out.println("hello world");
    System.out.println("hello world");
    }

    }

    C:\>javac hello.java

    C:\>java hello
    Exception in thread "main" java.lang.NoClassDefFoundError: hello

    C:\>ver

    Microsoft Windows XP [Version 5.1.2600]

    C:\>set
    ALLUSERSPROFILE=C:\Documents and Settings\All Users
    APPDATA=C:\Documents and Settings\Registered User\Application Data
    classpath=c:\java
    CLIENTNAME=Console
    CommonProgramFiles=C:\Program Files\Common Files
    COMPUTERNAME=DGNV5R0J
    ComSpec=C:\WINDOWS\system32\cmd.exe
    HOME=C:\jbase4\home
    HOMEDRIVE=C:
    HOMEPATH=\Documents and Settings\Registered User
    JBCGLOBALDIR=C:\jbase4\4.1
    JBCRELEASEDIR=C:\jbase4\4.1
    JREDIR=C:\jbase4\4.1\jdk\jre
    JRELIB=C:\jbase4\4.1\jdk\jre\bin\classic;C:\jbase4\4.1\jdk\jre\lib
    LOGONSERVER=\\DGNV5R0J
    NAVROOT=C:\jbase4\4.1\jDP
    NUMBER_OF_PROCESSORS=1
    OS=Windows_NT
    Path=C:\jbase4\4.1\MinGW\bin;C:\jbase4\4.1\jDP\bin;C:\jbase4\4.1\bin;C:\jbase4\4
    ..1\jdk\jre\bin\classic;C:\jbase4\4.1\jdk\jre\lib;C:\jbase4\4.1\config;C:\jbase4\
    4.1\jdk\jre\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Progr
    am Files\ATI Technologies\ATI Control Panel;C:\Program
    Files\Sonic\MyDVD;C:\Prog
    ram Files\Common Files\Adaptec
    Shared\System;c:\j2sdk1.4.2_05\bin;c:\qb45;c:\bat
    ches
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 7, GenuineIntel
    PROCESSOR_LEVEL=15
    PROCESSOR_REVISION=0207
    ProgramFiles=C:\Program Files
    PROMPT=$P$G
    SESSIONNAME=Console
    SystemDrive=C:
    SystemRoot=C:\WINDOWS
    TEMP=C:\DOCUME~1\REGIST~1\LOCALS~1\Temp
    TMP=C:\DOCUME~1\REGIST~1\LOCALS~1\Temp
    USERDOMAIN=DGNV5R0J
    USERNAME=Registered User
    USERPROFILE=C:\Documents and Settings\Registered User
    windir=C:\WINDOWS

    C:\>
     
    , May 7, 2005
    #1
    1. Advertising

  2. wrote:
    > I am on windows XP and i can't even run hello world.
    >
    > I've set up the classpath alright (see below) but when I run a program
    > it doesn't recognise the classname (see below).


    <snip/>

    Are you sure your classpath is set correctly? It should point to the
    location(s) where your classes can be found, not to the location of the
    java installation. Try setting it to c:\ or . (the current directory) in
    this case.

    Regards,
    Remco
     
    Remco de Boer, May 7, 2005
    #2
    1. Advertising

  3. Hal Rosser Guest

    Why don't you just download JGrasp. Its a Java editor with 1-click compile
    and 1-click run.
    When you install it - it will locate the Java fila installation and set
    itself to work.
    Makes programming a little simpler.

    <> wrote in message
    news:...
    > I am on windows XP and i can't even run hello world.
    >
    > I've set up the classpath alright (see below) but when I run a program
    > it doesn't recognise the classname (see below).
    >
    > I've tried uninstalling/re-installing java with the same result.
    >
    > I'm running java 1.4.2_05
    >
    > C:\>type hello.java
    > public class hello {
    >
    > public static void main(String[] args)
    > {
    > System.out.println("hello world");
    > System.out.println("hello world");
    > System.out.println("hello world");
    > }
    >
    > }
    >
    > C:\>javac hello.java
    >
    > C:\>java hello
    > Exception in thread "main" java.lang.NoClassDefFoundError: hello
    >
    > C:\>ver
    >
    > Microsoft Windows XP [Version 5.1.2600]
    >
    > C:\>set
    > ALLUSERSPROFILE=C:\Documents and Settings\All Users
    > APPDATA=C:\Documents and Settings\Registered User\Application Data
    > classpath=c:\java
    > CLIENTNAME=Console
    > CommonProgramFiles=C:\Program Files\Common Files
    > COMPUTERNAME=DGNV5R0J
    > ComSpec=C:\WINDOWS\system32\cmd.exe
    > HOME=C:\jbase4\home
    > HOMEDRIVE=C:
    > HOMEPATH=\Documents and Settings\Registered User
    > JBCGLOBALDIR=C:\jbase4\4.1
    > JBCRELEASEDIR=C:\jbase4\4.1
    > JREDIR=C:\jbase4\4.1\jdk\jre
    > JRELIB=C:\jbase4\4.1\jdk\jre\bin\classic;C:\jbase4\4.1\jdk\jre\lib
    > LOGONSERVER=\\DGNV5R0J
    > NAVROOT=C:\jbase4\4.1\jDP
    > NUMBER_OF_PROCESSORS=1
    > OS=Windows_NT
    >

    Path=C:\jbase4\4.1\MinGW\bin;C:\jbase4\4.1\jDP\bin;C:\jbase4\4.1\bin;C:\jbas
    e4\4
    >

    ..1\jdk\jre\bin\classic;C:\jbase4\4.1\jdk\jre\lib;C:\jbase4\4.1\config;C:\jba
    se4\
    >

    4.1\jdk\jre\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\P
    rogr
    > am Files\ATI Technologies\ATI Control Panel;C:\Program
    > Files\Sonic\MyDVD;C:\Prog
    > ram Files\Common Files\Adaptec
    > Shared\System;c:\j2sdk1.4.2_05\bin;c:\qb45;c:\bat
    > ches
    > PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    > PROCESSOR_ARCHITECTURE=x86
    > PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 7, GenuineIntel
    > PROCESSOR_LEVEL=15
    > PROCESSOR_REVISION=0207
    > ProgramFiles=C:\Program Files
    > PROMPT=$P$G
    > SESSIONNAME=Console
    > SystemDrive=C:
    > SystemRoot=C:\WINDOWS
    > TEMP=C:\DOCUME~1\REGIST~1\LOCALS~1\Temp
    > TMP=C:\DOCUME~1\REGIST~1\LOCALS~1\Temp
    > USERDOMAIN=DGNV5R0J
    > USERNAME=Registered User
    > USERPROFILE=C:\Documents and Settings\Registered User
    > windir=C:\WINDOWS
    >
    > C:\>
    >
     
    Hal Rosser, May 7, 2005
    #3
  4. writes:

    > C:\>java hello
    > Exception in thread "main" java.lang.NoClassDefFoundError: hello


    The current dir is not in the default classpath - use

    java -classpath . hello

    to run it.
     
    Tor Iver Wilhelmsen, May 8, 2005
    #4
  5. raven Guest

    hello world problem

    first set your environment path variable(in autoexec.bat) to point to
    the jdk\bin directory, where jdk is the directory where yout
    installed jdk 1.4.2_05. If you can't do it i suggest JCreator(.com),
    it's automatically configured to detect java directory.

    http://www.DevPlug.com --Connecting Developers
    Posted from: http://www.devplug.com/ftopic28131.htm
     
    raven, May 8, 2005
    #5
  6. Guest

    Re: hello world problem

    Thankyou everyone.
     
    , May 8, 2005
    #6
  7. Dale King Guest

    Tor Iver Wilhelmsen wrote:
    > writes:
    >
    >>C:\>java hello
    >>Exception in thread "main" java.lang.NoClassDefFoundError: hello

    >
    > The current dir is not in the default classpath - use


    Actually the current directory is in the default classpath. The problem
    is that Paul overrode the default with a bogus classpath.

    Unless you are using an ancient JVM you almost never want to actually
    set the class path.
    --
    Dale King
     
    Dale King, May 9, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Micha
    Replies:
    0
    Views:
    1,063
    Micha
    Nov 4, 2004
  2. Bonnie Johnson
    Replies:
    2
    Views:
    506
    Andrew Thompson
    Jan 10, 2007
  3. Ulf Meinhardt
    Replies:
    0
    Views:
    718
    Ulf Meinhardt
    Nov 13, 2007
  4. bonty
    Replies:
    0
    Views:
    89
    bonty
    Feb 25, 2007
  5. Sven Fischer
    Replies:
    0
    Views:
    420
    Sven Fischer
    Sep 27, 2012
Loading...

Share This Page