Java Confused
Java Confused

Reputation: 153

Javac not working properly or am I doing something wrong?

I've gotten my friend's project folder that a bunch of .java and .class files so that I could help him with his project. We are using git as our way of version control.

In the directory, I typed "javac *.java" but unfortunately I got a bunch of class reference errors, so I tried compiling them individually.

"javac A.java", which extends B, raised an error saying that it couldn't find symbol: class B. So I did "javac B.java" which did just fine, and then tried javac A.java again. The same error popped up saying that it couldn't find symbol: class B.

Does anyone know what's wrong, and what I should do?

Upvotes: 0

Views: 217

Answers (3)

cl-r
cl-r

Reputation: 1264

I've had to do same bunch decoding problem.

I'm not a good ant or maven user, so I let Eclipse manage them for me.

All warnings your are looking at will be clearly estimated and referenced before compiling and you will have tool to correct them.

Take few time to have the basic knowledge of Eclipse will give you coherence, and the code corrected will be readable by anyone, you work will be usefull.

Later you can look at other Eclipse tools like SVN to manage versionning, or listed in References menu item.

Upvotes: 0

Rick Mangi
Rick Mangi

Reputation: 3769

Why don't you use ant or maven to compile your stuff? You'll save yourself a lot of headache.

Upvotes: 0

akf
akf

Reputation: 39485

You should reference your classpath on the commandline. If all the classes are in your current directory, try javac -classpath . *.java

Upvotes: 4

Related Questions