This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with MSDOS

 
S Perreault
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maulin,
Yup, I totally forgot that I wasn't compiling it from the root.
Thanks for the heads up!
Perogi.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic