wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Difficulty Running a Program that imports user-define package 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 "Difficulty Running a Program that imports user-define package" Watch "Difficulty Running a Program that imports user-define package" New topic
Author

Difficulty Running a Program that imports user-define package

Sandra Bachan
Ranch Hand

Joined: Feb 18, 2010
Posts: 434
Hello,

On Chapter 1 of Sierra/Bates, they give code snippits:

Saved in /one/src/Toon.java



Saved in /one/src/Cloo.java



Saved in /one/src/Roo.java




I am able to compile by going to the terminal, navigating to the one directory, and typing in

javac -d ./classes/ ./src/*.java

So how do I run Toon? Which directory do I go to so I don't get errors such as:

Exception in thread "main" java.lang.NoClassDefFoundError: Toon



Marriage Made in Heaven
http://www.youtube.com/user/RohitWaliaWedsSonia
Sandra Bachan
Ranch Hand

Joined: Feb 18, 2010
Posts: 434
Bump

Any input?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Sandra Bachan wrote:Bump

Please read this.

Since Toon class is not in any package, so you need to go into /one/classes directory and run the command java Toon . That should work...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Sandra Bachan
Ranch Hand

Joined: Feb 18, 2010
Posts: 434
Awesome!

I appreciate the info provided in the link - usually this forum is very very responsive, hence anxious *BUMP*

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difficulty Running a Program that imports user-define package
 
Similar Threads
void return type is not allowded HF SCJP
Public Member Access
Compila errora help me :(
Is it printing mistake in SCJP 310-065 famous Kathy sierra book?
Cloo() imports package cert.Roo(), yet it cannot have it's own package