I guess I was in the same environment as everyone else.
Yet, I am the only one getting a lot of build errors and mysterious warnings.
I guess I have to destroy the errors one by one in such cases.
I have compiled a list of error resolution methods that you can use in Eclipse.
- Clean the project
- Clean Build Server
- Start with clean
- Check the Java version
- Match the compiler to the JDK version
- If you are using SVN
- Check the server settings
- Check the library
- Check resource paths
- If the path is not correct, use grep to search
- Extra: Check Style
Error-solving list
Clean the project
There is a possibility that the modification has not been reflected, so clean the project.
Project → Clean
If the cause of the problem has not been identified, check the "Start Build Immediately" checkbox and build the project.
When multiple projects coexist in the same project, there is no error when clean-building a single project.
Still, there is an error when clean-building the whole project.
In this case, I was told by a senior colleague that it is OK to do a clean build by itself, but I am not sure.
Clean Build Server
It is an effective method in case of errors on the server, so it is not related to build errors but clean the server just in case.
Select the server from the server view, right-click → Clean
If there is no server, adding a server and a project may clear the error.
Start with clean
There might be some garbage data, so try to start with clean.
Create an eclipse shortcut key
Right-click on the shortcut key → Properties
Add "- clean" at the end of the link
Example: xx.exe - clean
Check the Java version
A difference between the Java version used in the project and the version of Java in the local environment can cause many errors.
Window → Preferences → Java → Installed JRE
If the version shown here is different from your project, add the correct JAVA JDK. Since this is the default Java, check the project version as well.
If the JRE and JDK versions are the same, then it is common to keep the JDK, although both JDK and JRE are the same.
Depending on where you downloaded the JDK, it is common to select JDK for C:\Program Files\Java. Double-check that you are loading the JDK in the intended path.
Match the compiler to the JDK version
If the version of the JDK is different from the version of the compiler, it may cause errors.
Open Window → Preferences → Java → Compiler.
Check if the compiler compliance level in JDK Compliance is correct.
Even if it is correct, change to another version and apply. Change it back again.
The same error did not occur even if I reverted to the original version once I fixed it.
If you are using SVN
If you are using SVN, you can also try the following.
Project → right click → update
Project → right click → Team → Cleanup
Do a project cleanup as well.
If the update doesn't work, try closing the project.
Project → right-click → close project
After closing, reopen the project.
It worked for me when I had multiple projects.
Check the server settings
It may not be related to the build error, but check the server settings.
Double click on the server (overview)
General Information → Runtime → JRE is correct?
Check if the server path is correct.
Check the library
Project → right-click → "Build Path" → "Build Path Configuration" → "Library" tab
Even if the library is included, removing it once and then adding it again and applying it may fix the problem.
Also, check the other tabs to see any strange paths.
Check resource paths
Project → Right-click → Property → Resource
Check if the path is correct.
If the path is not correct, use grep to search
If the path is incorrect, use grep to search for the wrong path. In case you use Sakura Editor.
ctrl + g
Condition: Word you want to search
File: *. *.
Folder: Top-level folder you want to search
Later defaults
Search
Checks for suspicious items that have been caught.
Extra: Check Style
If there are no special instructions for check styles, you can ignore them.
Summary
It summarizes what we have found to be effective in resolving the errors we have experienced many times.
Java Book for Beginner
The most important selling points of Head First Java is its simplicity and super-effective real-life analogies that pertain to the Java programming concepts.
It is also the best book to learn java and start your learning journey with Java Development.
Head First Java covers almost all OOPS concepts and fascinatingly explains them.
Despite several readers claiming it to be a dated book, as it covers nothing beyond Java 5.0, Head First Java is still found on the shelves of numerous Java veterans.
Thus, it is a must-have book for every Java pursuer and developer.