Home > Back-end >  About the javac compiler error could not find the error symbol classes
About the javac compiler error could not find the error symbol classes

Time:02-28

I wrote this code the first two. Java files, were named for project
The two Source file path in G:/Java/Source folders below
Then I go to the UserInfo. Java compilation successful the generated in G:/Java/project. This parcel and it contains the UserInfo class file
However, when I was in the same way to compile MyJava. Java file I could not find symbol error when the UserInfo, that is why
 

CodePudding user response:

Find the reason, because it is a novice, don't quite understand why ah, javac - d../* Java
Through this command, compile the Source folder below all. To compile the Java file is not an error
I guess, probably because need to compile all together to get the relationship between reference up to no error
However the goose, when I was in executing Java MyJava error again
The emergence of a new problem:
G: \ Java \ project> Java MyJava
Error: cannot find or unable to load the main class MyJava
Reason: the Java. Lang. NoClassDefFoundError: project/MyJava (wrong name: MyJava)


This is why, and relevant environment variable, or said I am the components of the problem of the missing

CodePudding user response:

Problem has been solved completely, the path of the currently executing command is wrong, need to return to a pre-compiled package project supervisor directory to
And then execute the Java project. MyJava such forms, in the superior directory using the command and specify the package name, this time can success
  • Related