-
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?
-
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?
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks