How to get class file using Eclipse?

I wrote an application in Eclipse that was successfully compiled and launched. After that, I found the * .java and * .class files in the corresponding directory. Then I deleted the * .class file, and now I do not know how I can return it.

Eclipse writes to me: "The class file was not written. The project may be inconsistent if you try to update this project and create it."

By right-clicking on the project, I got a drop-down menu in which I found β€œRefresh”, but I can’t find out how I can β€œbuild” the project.

So how can I generate the class file again?

Thanks in advance for any help.

+4
source share
2 answers

Purge (Menu: Project β†’ Purge ...) enough to start the assembly project. Make sure auto-build is enabled (Project -> Build Automatically). If auto-build is disabled, use build all (Menu: Project β†’ Build All).

+9
source

I get this error message when I have an inner class and the common name of the main class and its inner classes exceeds 128 characters. This happens on both OpenJDK and Sun JDK 6. The solution for me was to reduce the internal class names.

0
source

Source: https://habr.com/ru/post/1301564/


All Articles