aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes knb page# 793 doubt. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "knb page# 793 doubt." Watch "knb page# 793 doubt." New topic
Author

knb page# 793 doubt.

Minhaj Mehmood
Ranch Hand

Joined: Jan 22, 2007
Posts: 400



its giving me following error and i have jdk6 installed.
===
javac: file not found: com\wickedlysmart\MyClass.java
Usage: javac <options> <source files>
use -help for a list of possible options

but in book page# 793 the error message is different!


Note: i have give wrong value to -d param "classes1" which is not available onto file system and while compiling through "javac -d ../classes com/wickedlysmart/MyClass.java" its just compiling fine, no error.


SCJP6 96% | SCWCD5 81% | SCDJWS5 79%
Rajiv Chopra
Ranch Hand

Joined: Dec 19, 2008
Posts: 62
Minhaj kaimkhani wrote:

its giving me following error and i have jdk6 installed.
===
javac: file not found: com\wickedlysmart\MyClass.java
Usage: javac <options> <source files>
use -help for a list of possible options

but in book page# 793 the error message is different!


Note: i have give wrong value to -d param "classes1" which is not available onto file system and while compiling through "javac -d ../classes com/wickedlysmart/MyClass.java" its just compiling fine, no error.



Hi , I am getting the following message while compiling like you. instead of classes i am using classes1 which doesn't exist. I think this is similar to what book mention. I have JDK5.

C:\myProject\source> javac -d ../classes1 com/wickedlysmart/MyClass.java
com/wickedlysmart/MyClass.java:2: error while writing com.wickedlysmart.MyClass:
..\classes1\com\wickedlysmart\MyClass.class (The system cannot find the path sp
ecified)
public class MyClass{
^
1 error

Rajeev Kumar
SCJP 6.0 Certified 96%
Rajiv Chopra
Ranch Hand

Joined: Dec 19, 2008
Posts: 62
Rajiv Chopra wrote:
Minhaj kaimkhani wrote:

its giving me following error and i have jdk6 installed.
===
javac: file not found: com\wickedlysmart\MyClass.java
Usage: javac <options> <source files>
use -help for a list of possible options

but in book page# 793 the error message is different!


Note: i have give wrong value to -d param "classes1" which is not available onto file system and while compiling through "javac -d ../classes com/wickedlysmart/MyClass.java" its just compiling fine, no error.



Hi , I am getting the following message while compiling like you. instead of classes i am using classes1 which doesn't exist. I think this is similar to what book mention. I have JDK5.

C:\myProject\source> javac -d ../classes1 com/wickedlysmart/MyClass.java
com/wickedlysmart/MyClass.java:2: error while writing com.wickedlysmart.MyClass:
..\classes1\com\wickedlysmart\MyClass.class (The system cannot find the path sp
ecified)
public class MyClass{
^
1 error




I changed my JDK to 1.6 now message is same like in book.

C:\>java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode)

C:\>cd myProject

C:\myProject>cd source

C:\myProject\source>javac -d ../classes1 com/wickedlysmart/MyClass.java
javac: directory not found: ../classes1
Usage: javac <options> <source files>
use -help for a list of possible options
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18988
    
  40

@Rajiv

I am not entirely sure of the reason why you are trying to reproduce the issue. The original poster of this topic already mentioned that the issue was found, and that it compiles now...




Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Rajiv Chopra
Ranch Hand

Joined: Dec 19, 2008
Posts: 62
Henry Wong wrote:@Rajiv

I am not entirely sure of the reason why you are trying to reproduce the issue. The original poster of this topic already mentioned that the issue was found, and that it compiles now...




Hi,

Issue is he is not getting the right error message if he provide wrong direcotry name. Error should say directory not found but he is getting file not found what he is trying to compile.

If directory exists he compiles just fine.
But if directory not exists he is getting different message than book.( thats why i was compiling on my system and I am getting similar answer as on book).
Minhaj Mehmood
Ranch Hand

Joined: Jan 22, 2007
Posts: 400

Henry Wong wrote:@Rajiv
I am not entirely sure of the reason why you are trying to reproduce the issue. The original poster of this topic already mentioned that the issue was found, and that it compiles now...


Henry, No issue is not found still -- the error message I'm getting is totally different than mentioned in book..
Rajiv Chopra
Ranch Hand

Joined: Dec 19, 2008
Posts: 62
Minhaj kaimkhani wrote:
Henry Wong wrote:@Rajiv
I am not entirely sure of the reason why you are trying to reproduce the issue. The original poster of this topic already mentioned that the issue was found, and that it compiles now...


Henry, No issue is not found still -- the error message I'm getting is totally different than mentioned in book..


can you let me know the version of java you are using.
C:\>java -version

you can see what version i am using and what I am getting above.
Minhaj Mehmood
Ranch Hand

Joined: Jan 22, 2007
Posts: 400

yes its java6.

$>java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
Rajiv Chopra
Ranch Hand

Joined: Dec 19, 2008
Posts: 62
Minhaj kaimkhani wrote:yes its java6.

$>java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)


hey you are using Unix enviornment thats why ../ is not working.
change the directory name to anything that is not there like classes you will get direcctory not found error.
$ javac -d classes1 com/wickedlysmart/MyClass.java
javac: directory not found: classes1
Usage: javac <options> <source files>
use -help for a list of possible options
 
 
subject: knb page# 793 doubt.