wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes classpath problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "classpath problem" Watch "classpath problem" New topic
Author

classpath problem

Gina Pandher
Greenhorn

Joined: Sep 21, 2000
Posts: 19
Hi all
Can anyone tell me how to set my classpath so i can compile my source code whether it is saved in the bin or anywhere on my hard drive. I have been saving all my .java files in the bin directory and then on the c prompt i have been using
c:\jdk1.2.2\bin>javac MyFile.java
to compile my code. I want to be able to save my source file elsewhere and run the javac without going to the bin everytime.
Please help !
Noah Carroll
Ranch Hand

Joined: Sep 20, 2000
Posts: 96
Gina,
The classpath is not what allows you compile programs from any directory. You need to set your path. The best way to do this is to run sysedit and open your autoexec.bat file and add c:\jdk1.2.2\bin to the end of the path line. Do not delete the original path, only add that line.

I hope this helps

Noah Carroll noahcaroll@juno.com
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Perhaps the Installation instructions can help it covers setting your path and classpath plus a real good explaination of what classpath means and how java uses it.
Hope this helps


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Gina Pandher
Greenhorn

Joined: Sep 21, 2000
Posts: 19
Originally posted by Noah Carroll:
Gina,
The classpath is not what allows you compile programs from any directory. You need to set your path. The best way to do this is to run sysedit and open your autoexec.bat file and add c:\jdk1.2.2\bin to the end of the path line. Do not delete the original path, only add that line.
I hope this helps
Noah Carroll noahcarroll@juno.com

When i run autoexec.bat this is what i get
SET BLASTER=A240 I5 D1 T4
LH C:\WINDOWS\AU30DOS.COM
@ECHO OFF
rem
rem *** DO NOT EDIT THIS FILE! ***
rem
rem This file was created by the System Configuration Utility as
rem a placeholder for your AUTOEXEC.BAT file. Your actual
rem AUTOEXEC.BAT file has been saved under the name AUTOEXEC.TSH.
rem

SO I OPENED AUTOEXEC.TSH AND THIS IS WHAT I GOT......I DONT SEE THE WORD "PATH" ANYWHERE
@C:\PROGRA~1\NORTON~1\NAVDX.EXE /Startup
SET BLASTER=A240 I5 D1 T4
LH C:\WINDOWS\AU30DOS.COM
@ECHO OFF
REM [Header]
REM [CD-ROM Drive]
REM C:\WINDOWS\COMMAND\MSCDEX /D:MSCD001
REM [Miscellaneous]
REM [Display]
mode con codepage prepare=((850) c:\windows\COMMAND\ega.cpi)
mode con codepage select=850
CAN YOU OFFER ANY MORE SUGGESTIONS???

Steven YaegerII
Ranch Hand

Joined: May 31, 2000
Posts: 182
Here's the link that got me out of it awhile back:
http://www.naviseek.com/users/rcade/books/java2412/jdkhelp6.shtml
...it is probally wise to save a copy of your original AUTOEXEC.BAT file.
[This message has been edited by Steven YaegerII (edited September 21, 2000).]
Gina Pandher
Greenhorn

Joined: Sep 21, 2000
Posts: 19
Thank you much for all the useful information !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: classpath problem
 
Similar Threads
cannot find [filename].java
Emma Coverage report Error
Ant - Cannot find webwork ActionSupport
-classpath command revisited
Javac: File Not Found