Setting the classpath


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Setting the classpath

Hybrid View

  1. #1
    ED Guest

    Setting the classpath


    Hello, just wondering how to reset my classpath. I'm running windows 2k, and
    my understanding was that it was set throught the ControlPanel\System\Advanced\EnvironementVariables\Path
    I've set the path to C:\j2se1.4.0\bin but it still doesn't work, and I'm
    getting the following messages - 'javac' is not recognized as an internal
    or external command, operable program or batch file.

    Obviously, there is a folder called j2se1.4.0 off the c root, and I am saving
    the files in c:\javaWork
    The javac command will compile and create the .class file when I enter the
    full path, but the application will not run with the java classname command...Any
    ideas?

  2. #2
    Kent Guest

    Re: Setting the classpath


    ED,

    The CLASSPATH tells the JRE where to find your compiled classes. The PATH
    variable tells Windows where to search for commands entered on the command
    line. If you're receiving an error when typing 'java' on the command line
    you need to add the bin directory to your PATH.

    To do this permanently follow the steps you mentioned below except modify
    the PATH variable instead of the CLASSPATH.

    Regards,
    Kent


    "ED" <eduffy@biovectra.com> wrote:
    >
    >Hello, just wondering how to reset my classpath. I'm running windows 2k,

    and
    >my understanding was that it was set throught the ControlPanel\System\Advanced\EnvironementVariables\Path
    >I've set the path to C:\j2se1.4.0\bin but it still doesn't work, and I'm
    >getting the following messages - 'javac' is not recognized as an internal
    >or external command, operable program or batch file.
    >
    >Obviously, there is a folder called j2se1.4.0 off the c root, and I am saving
    >the files in c:\javaWork
    >The javac command will compile and create the .class file when I enter the
    >full path, but the application will not run with the java classname command...Any
    >ideas?



  3. #3
    MarkN Guest

    Re: Setting the classpath


    If you are not using an IDE to do java, you would be best served not depending
    on Windows to properly set your classpath and path. (It would be best not
    to depend on Windows at all - didn't say use )

    Set the path and classpath at runtime, not in the environment variables,
    via a bat file or other script file. Installing one program can mess you
    up if you don't. Also involved in the process is the registry. It determines
    what the current version of Java is. Your application may not use the one
    you desire if you depend on system environmental variables.

    Another note - if you are doing JDBC, ensure the drivers dlls are in your
    path.

    Ok - another note - The classpath and path env variables are limited in length.
    Windows 2k 's are longer than Win9X.

    Mark


    "Kent" <kb@essential.com.au> wrote:
    >
    >ED,
    >
    >The CLASSPATH tells the JRE where to find your compiled classes. The PATH
    >variable tells Windows where to search for commands entered on the command
    >line. If you're receiving an error when typing 'java' on the command line
    >you need to add the bin directory to your PATH.
    >
    >To do this permanently follow the steps you mentioned below except modify
    >the PATH variable instead of the CLASSPATH.
    >
    >Regards,
    >Kent
    >
    >
    >"ED" <eduffy@biovectra.com> wrote:
    >>
    >>Hello, just wondering how to reset my classpath. I'm running windows 2k,

    >and
    >>my understanding was that it was set throught the ControlPanel\System\Advanced\EnvironementVariables\Path
    >>I've set the path to C:\j2se1.4.0\bin but it still doesn't work, and I'm
    >>getting the following messages - 'javac' is not recognized as an internal
    >>or external command, operable program or batch file.
    >>
    >>Obviously, there is a folder called j2se1.4.0 off the c root, and I am

    saving
    >>the files in c:\javaWork
    >>The javac command will compile and create the .class file when I enter

    the
    >>full path, but the application will not run with the java classname command...Any
    >>ideas?

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center