60

I am getting errors from Eclipse Indigo running on Windows 7 Ultimate. For each of the following items:

Android SDK content loader
Building workspace
Initializing Java Tooling
Loading data for Android 2.3.3
Loading data for Android 4.03

this error is thrown:

 An internal error occurred during: "Initializing Java Tooling".java.lang.NullPointerException

What should I do?

Keith Pinson
  • 7,835
  • 7
  • 61
  • 104
al23dev
  • 845
  • 2
  • 8
  • 17
  • 1
    Your workspace might be corrupted. Try to create a blank new workspace then import your existing projects into it. – papaiatis Jun 05 '12 at 06:47
  • 2
    How does the workspace get corrupted? NullPointerException is a bug to be fixed no matter what is corrupted. Does anyone know why exactly this exception is thrown? – ed22 Nov 14 '17 at 10:44
  • https://stackoverflow.com/a/11118313/4294399 – General Grievance Aug 19 '22 at 14:25

22 Answers22

38

Delete your existing workspace and then recreate the workspace and add your projects.

NiallMitch14
  • 1,198
  • 1
  • 12
  • 28
Abhinai
  • 1,082
  • 2
  • 13
  • 20
  • 28
    It's better, that is, it's easier and probably safer, to not use this method first. It's better to try closing and reopening projects as suggested in the [other answer below](http://stackoverflow.com/a/11982469/543738). – Mr. Lance E Sloan Mar 06 '13 at 15:12
  • 1
    I tried closing and re-opening the project which took care of this problem. BUT I had other side-effects (CTRL+SHIFT+R did not get all files in the project). So finally deleted and re-created the project – Toothless Seer Mar 09 '16 at 21:29
  • 1
    Also increase Eclipse's memory, if possible, also suggested, to minimize the changes of happening in the first place. – Felix Aug 11 '17 at 14:26
  • 1
    I've simply exited Eclipse, and opened it again. - Classics ! – 3xCh1_23 Jan 05 '18 at 14:37
  • I see this is the solution but I would like if you guys could explain why does it happen. – JD Gamboa Aug 18 '19 at 19:14
23

Just change the following values at "eclipse.ini" file to the following:

-Xms1024m
-Xmx2048m

Note:

  • You can find the "eclipse.ini" file by right click eclipse icon on and select "Open file location".
  • This error occurs because the eclipse is running out of memory, so we just increased the assigned memory for the eclipse application.
  • 1
    Good answer, but you might want to add some information as to _why_ this change is needed to fully answer the question. Is it because eclipse is likely running out of memory? Explain how to check and apply the work around. – danny Jul 31 '17 at 13:11
  • Why it works? Because it refreshes your .plugins specially jdt,oomph,common,etc. – Manjeet Sep 22 '18 at 14:19
  • BOOM! This solved the problem after restarting Eclipse! Thank you! – Wulf Mar 07 '19 at 19:58
  • Didn't work for me – JohnK Jan 27 '22 at 14:23
15
  1. Close Eclipse.
  2. Go to workspace folder in windows explorer and delete following folders:
    • .metadata
    • .recommenders
    • RemoteSystemsTempFiles
    • Servers
  3. Open Eclipse and provide the same workspace folder again during launch.
Sunny Tambi
  • 2,393
  • 3
  • 23
  • 27
10

I would just like to add, that simply closing and reopening eclipse has always worked for me with this type of error.

Zsolt Z.
  • 592
  • 6
  • 17
5

NO Need to create another work-space and import all the projects from the older one : Just empty \Workspaces\MyEclipse 8.5 M2\.metadata\.plugins\org.eclipse.core.resources\.projects directory and restart myeclipse/eclipse

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
DIleep
  • 61
  • 1
  • 1
4

I faced the same issue. But changing two configuration in eclipse.ini resolved my issue.

-Xms512m to -Xms1024m and -Xmx1024m to -Xmx2048m

Saket Sinha
  • 521
  • 4
  • 3
2
  1. Check your Project -> Properties -> Java Build Path has JDK Library instead of JRE System Library.

  2. Go to Eclipse installed directory, Search eclipse.ini -> Open it

Search lines for containing any below values:

-Xms512m -Xmx512m -Xms1024m -Xmx1024m -Xms1G -Xmx1G

Just double it the memory size, Assume you have to change the

-Xms512m to -Xms1024m

Increasing the eclipse memory size will help eclipse to gain more RAM size from your PC.

ArifMustafa
  • 4,617
  • 5
  • 40
  • 48
1

In my case, I restarted my eclipse IDE without deleting/editing my workspace or .metadata folder. Error "An internal error occurred during: "Initializing Java Tooling". java.lang.NullPointerException" is gone and Eclipse just working good.

Saravanan
  • 11
  • 1
1

Sometimes the issue is with the version of the Java installed. I was facing a similar issue when trying to start Spring Tool Suite on my Ubuntu 16.04. I had java 9 installed on my machine. I changed it to java 8. And it started working.

Sunil Kumar
  • 535
  • 6
  • 13
1

My issue was caused by some old Java projects using an old JRE System Library, so all I had to do was remove the old library and add the new one by right clicking the project -> Properties -> Java Build Path -> Libraries -> Add Library.

enter image description here

Chris Gong
  • 8,031
  • 4
  • 30
  • 51
1

I was facing the same issue in eclipse so I am telling you the same step that I did you just need to go eclipse installed folder where you will find the file named eclipse.ini in my case the location was

C:\Users\comp\eclipse\jee-2018-12\eclipse

you can find your location.

in that location, open eclipse.ini in text mode and there you will find some below text
-Xms256m -Xmx1024m

change it to

-Xms512m -Xmx1024m

I hope that will help you 100% as checked in my System ;-)

0

Just delete the .metadata on workspace, and restart IDE and configure it again properly

0

My problem too got fixed which i was getting on STS, just closed all the project's including the server on the project explorer, restarted ide, that's it.

Rajan Chauhan
  • 461
  • 2
  • 7
  • 18
0

check the Eclipse log (the intelligently named ".log" file in your workspace .metadata folder) and check for the complete stacktrace. In my case it was caused at method "org.eclipse.m2e.jdt.internal.MavenClasspathVariableInitializer.initialize(MavenClasspathVariableInitializer.java:30)" which lead to a never fixed "race condition during startup" bug. I would really recommend dumping Eclipse in favor of a more serious IDE; like IntelliJ or Netbeans. Using Eclipse means that you will invest 40-50% of your time trying to work around this kind of bugs, instead of being productive.

Pierluigi Vernetto
  • 1,954
  • 1
  • 25
  • 27
0

Just close the Eclipse or STS and restart it again. This may fix this error.

Jack
  • 165
  • 2
  • 10
0

I faced the same issue. Switching back to the predefined work-space from the Switch workspace option in eclipse solved my issue.

Chitraveer Akhil
  • 147
  • 1
  • 5
  • 18
0

In my case "MySQL service" is disabled. And I got same error.

So if you are using MySQL then check for it.

Press win+R then write services.msc and hit enter. Search for MySQL service. Start the service.

Deepak Gautam
  • 1,309
  • 12
  • 14
0

In my case, I had two of three projects with this problem in my current workspace. I opened workspace catalog and made a backup of corrupted projects, deleted them afterwards. Then opened eclipse once again. Obviously there was missing data to work with. Closed eclipse once again and added back earlier saved projects without metadata catalogs.

TL;DR. Just remove metadata catalogs from projects in your workspace.

Karolis
  • 163
  • 1
  • 9
0

In my case, Eclipse tried to launch with non-existing workspace folder. Sure the folder is created at the moment, but the exception is occured durring creating the workspace. After the exception I just switched workspace to the right folder. To avoid slipping to non-existing workspace folder I deleted it from Recent workspaces.

pburgr
  • 1,722
  • 1
  • 11
  • 26
0

In my case even after deleting the workspace and reimport doesn't work. Because all the files are Corrupted. so have utilized my existing backup data, extracted it & reimported into workspace then it started working fine.

anand krish
  • 4,281
  • 4
  • 44
  • 47
0

Upgrading Eclipse to the latest version (2020-12, 4.18.0) fixed the bug for me.

Don Smith
  • 473
  • 4
  • 10
0

Instead of deleleting the workspace & losing the code, try uninstalling the AWS toolkit and then just reinstall it. By going in:

Help > Market Place > search for AWS toolkit > click install button > click change button > uninstall.

Do the same for reinstalling & restart the Eclipse IDE so that it will configure by itself.

halfer
  • 19,824
  • 17
  • 99
  • 186
Aamer
  • 417
  • 3
  • 9