This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javac error

 
Nick Petas
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please submit the code?
 
Angus Comber
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you have a system CLASSPATH that doesn't include the current working directory.
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic