Eclipse: Errors occurred during the build. Errors running builder 'Java Builder'

Viewed 16696

I'm having an error while trying to make Eclipse Oxygen work in Kubuntu 16.04. Whenever I open a file, and sometimes on Eclipse startup too even if there's no open ones, I get many errors, in particular some I can't copy that occur when I try to use code completion, and most of all this one:

Errors occurred during the build.
Errors running builder 'Java Builder' on project 'MyFirstAfterReinstallAndPlugin'.
java.lang.NullPointerException

I have to specify that this started to occur after I downloaded the extension for Java 9 support and created a new project with the Java_SE9 JRE: before that it would behave in another strange way. Code correction wouldn't find the "System" class and a lot of strange errors happened. I have installed openjdk9 and javac from command line works fine. Plus Eclipse said that I had to have Java 1.8 or superior, making the fact that it didn't work before strange as well.

I've tried everything I found online but still can't figure this out.

7 Answers

I solved this problem simply by deleting the project causing the trouble, and then re-importing it in Eclipse.

  1. Delete the project from the Eclipse workspace.
    (i) Simply 'remove' the project: not delete its files !!

    PROCESS:

    • Right-clic on the project to delete.
    • Context-menu :>Delete
    • DO NOT 'Delete project contents on disk' !!
  2. Then, reimport the project.

    PROCESS:

    • menu :>File/>Import
    • />Existing Project into Workspace
    • ...

I was also getting the following error. To fix this I changed the Build class path order so that the JRE was listed last. (Project Properties>Java Build Path>Order and Export) Errors running builder 'Java Builder' java.lang.NullPointerException on project X

I was getting the same error, after searching up for the answer I tried to do the following:

1.) I created back up of my project on the disc.

2.) Deleted the project that was causing the problems(for me it was 1 of 9 projects).

3.) At last I reimported the project from the remote repository & the problem was solved

4.OPTIONAL) I did merge the changes that Ive had to the current project with the backed up version.

I have run into this problem when I was updating the the newest version of Eclipse (Photon) using the updater from OOMPH.It already struck me that reloading the target did not follow the usual steps and was finished quite quickly, but it didn't make the problems mentioned above go away. Also the solutions mentioned above did not work. As it transpired, I had JAVA 8 installed on my system, and Photon requires JAVA 11 or up. Wven I manually updated my system to the newest JAVA system, and added:

-vm C:\Program Files\Java\jdk-15.0.2\bin

to the eclipse.ini file in the Eclipse folder, the problem was resolved

Related