Hi friends,
I'm preparing the text book by K&B for
SCJP 5.0 & quite new to this forum.
I have a problem in -cp in lesson 10 as per the book. I'm using WindowsXP & jdk-1_5_0.
Scenario:
My
java file to be compiled is on C:\ls10\A\A1\Test.java. But iwant it compiling & running from C:\ls10. I attempted as
C:ls10>javac -cp A\A1 Test.java (doesn�t work)
C:ls10>javac -cp .;A\A1 Test.java (doesn�t work)
but once i compiled with out using class path by
C:ls10>javac A\A1\Test.java (compilation succeeds)
then, the -cp works to run the Test.class file
C:ls10>java -cp A\A1
Test(works & i get the output)
Can some one please tell why -cp doesn�t work for compilation but works for running the program even when i attempted from the same directory by using the same directory structure with -cp for both 'javac' & 'java' ?
Thanks in advance.
jagan.k