Aire
Aire

Reputation: 127

Program compiling in Eclipse but not in Command Prompt

Basically, my program compiles and runs fine in Eclipse but doesn't compile in Command Prompt. It gives me Symbol Not Found with the pointer on the name of one of my classes. I've never had this happen before- the only difference between this program and the other ones I wrote is that I made a package in Eclipse for them. Any ideas?

Upvotes: 1

Views: 3102

Answers (2)

user3212834
user3212834

Reputation: 11

If you did not do it already, it might help if you remove the package declaration in the java files. If your compiling class uses any other classes, they will not be compiled because of the package declaration. It happened with me once.

Upvotes: 0

Gundamaiah
Gundamaiah

Reputation: 786

I think you didn't set the path correctly.

How to set Path in Java

The path is required to be set for using tools such as javac, java etc.

If you are saving the java source file inside the jdk/bin directory, path is not required to be set because all the tools will be available in the current directory.

But If you are having your java file outside the jdk/bin folder, it is necessary to set path of JDK.

Upvotes: 2

Related Questions