compile/run locations
From: Pete (pete_at_ima-web.com)
Date: 02/27/05
- Next message: mary: "HTTP-REFERER in JAVA From Inside an HTML document?"
- Previous message: iSyncLtd_at_hotmail.com: "Re: Java Object-Oriented Prgramming- Basics for High School Course ???"
- Next in thread: klynn47_at_comcast.net: "Re: compile/run locations"
- Reply: klynn47_at_comcast.net: "Re: compile/run locations"
- Reply: arvind via JavaKB.com: "Re: compile/run locations"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 26 Feb 2005 19:42:37 -0800
i am a bit confused on something and i'm just looking for some
clarification..... i just installed JAVA SDK 1.4.2 on my laptop w/XP
on it.... on the JAVA 2 SDK 1.4.2 installation notes for Microsoft
Windows, it says"set the PATH variable if you want to be able to
conveniently run the JAVA 2 SDK executables (javac.exe, java.exe,
javadoc.exe, etc.) from any directory without having to type the full
path of the command. If you don't set the PATH variable, you need to
specify the full path to the executable every time you run it such as:
c:>j2sdk1.4.2_<version>\bin\javac MyClass.java" and this makes complete
sense to me....
i have my java programs here:
c:\javaprograms
my sdk is here:
c:\j2sdk1.4.2_07
on my laptop i do not have my PATH variable set, yet i am still able to
execute java.exe without specifying the path to the java.exe program
(as required by the installation notes) such as:
c:\>java -classpath "javaprograms" helloWorld
Hello World!
however, i am not able to use the compiler in the same way, such as:
c:\>javac -classpath "javaprograms" helloWorld.java
'javac' is not recognized as an internal or external command,
operable program or batch file.
the fact that i'm able to execute JAVA programs in the foregoing manner
is inconsistent with the JAVA 2 SDK 1.4.2 installation notes for
Microsoft Windows, but consistent with regard to compilation, i.e. it
doesn't work.... does anyone know how or why the java.exe would work
and not the javac.exe program, in the preceding context, that is,
without the PATH variable set and without a specified full path to the
executable???
second, if i wanted to get the compiler to work, the only command that
works for me is:
c:\>j2sdk1.4.2_07\bin\javac javaprograms\helloWorld.java
but the next one doesn't work:
c:\>j2sdk1.4.2_07\bin\javac -classpath "javaprograms" helloWorld.java
error: cannot read: helloWorld.java
1 error
why would the first one work and not the second???
Thanks!!!!
Pete
- Next message: mary: "HTTP-REFERER in JAVA From Inside an HTML document?"
- Previous message: iSyncLtd_at_hotmail.com: "Re: Java Object-Oriented Prgramming- Basics for High School Course ???"
- Next in thread: klynn47_at_comcast.net: "Re: compile/run locations"
- Reply: klynn47_at_comcast.net: "Re: compile/run locations"
- Reply: arvind via JavaKB.com: "Re: compile/run locations"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|