compile/run locations

From: Pete (pete_at_ima-web.com)
Date: 02/27/05


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



Relevant Pages

  • Re: run question.
    ... SDK or JRE installation. ... usually the installation of third-party libraries. ... CLASSPATH (since you are relatively new to Java), ...
    (comp.lang.java.programmer)
  • Problem excuteing RPM form java
    ... I want to install RPM's out of a java ... the installation the programm hangs forever. ... I think when rpm trys to execute the per/postscripts it attempts to ...
    (comp.lang.java.help)
  • Problem excuteing RPM form java
    ... I want to install RPM's out of a java ... the installation the programm hangs forever. ... I think when rpm trys to execute the per/postscripts it attempts to ...
    (linux.redhat)
  • Problem excuteing RPM form java
    ... I want to install RPM's out of a java ... the installation the programm hangs forever. ... I think when rpm trys to execute the per/postscripts it attempts to ...
    (comp.lang.java.programmer)
  • Re: Which JVM is this?
    ... Java HotSpotClient VM ... Peter, I've installed this same SDK, and these two commands yield the same output as on your machine. ... But I noticed during the installation that it says build 63, ... In the thread "New java 1.4.2.9" Michael reports the JRE version output is wrong... ...
    (comp.os.os2.apps)