aspose file tools*
The moose likes Beginning Java and the fly likes Problem with MSDOS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem with MSDOS" Watch "Problem with MSDOS" New topic
Author

Problem with MSDOS

S Perreault
Ranch Hand

Joined: Oct 29, 2003
Posts: 37
I feel stupid even writing this but I am having trouble compiling a class that implements an interface. Both the class and the interface are in the same directory.
For instance, I am working on the RMI example on the Sun site and I have two files: Calculator.java (interface) and CalculatorImpl.java (Implementor of Calculator)
Code for both:


I can open up a DOS window and compile the Calculator.java interface with no problem. If I attempt to compile the CalculatorImpl.java class, I get this error:

Thanks for any ideas!
Perogi.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8971
    
    9

Your classpath probably does not include the current directory. Either run:
javac -classpath . CaculatorImpl.java
Or compile them both at the same time:
javac Calculator*.java


[How To Ask Questions On JavaRanch]
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
Hi
Assuming,
1. you have the directories with names, suncertify and test where test is subdir of suncertify and
2. you have your .java files in suncertify\test\
3. and just for simplicity you have suncertify folder in C:\> then you can do following,
C:\>javac suncertify\test\*.java
And see if that works.
Its usually recommended that we have the same source hierarchy as in package names and with packages, I have "never" tried to compile the code via going into any of the package directories and then do javac. Always be in "parent of the package directory and compile all sources via *.java thing"...
Hope this solves your problem.
Regards
Maulin
S Perreault
Ranch Hand

Joined: Oct 29, 2003
Posts: 37
Maulin,
Yup, I totally forgot that I wasn't compiling it from the root.
Thanks for the heads up!
Perogi.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problem with MSDOS