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

Javac error

Nick Petas
Ranch Hand

Joined: Jan 31, 2007
Posts: 38
I have three classes in the same directory.
The 3rd class is using one of the others.
Although I have compiled the first two classes in the same directory , when I try to compile the 3rd class I get the classic cannot find symbol error pointing to the type that is already compiled in this same directory.
How can I overcome this problem?
Thank you.
Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 499

Could you please submit the code?


Are you better than me? Then please show me my mistakes..
Angus Comber
Ranch Hand

Joined: Jul 16, 2011
Posts: 90
Here is an example of how it works for me:


javac B.java
javac A.java

Then run:
java A

Works for me.

What code do you have and how are you compiling and running?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

Maybe you have a system CLASSPATH that doesn't include the current working directory.


luck, db
There are no new questions, but there may be new answers.
Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 499

Angus Comber wrote:Here is an example of how it works for me:


javac B.java
javac A.java

Then run:
java A

Works for me.

What code do you have and how are you compiling and running?


You said you have 3 classes, so where is the third one? These two are fine.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Javac error