简体   繁体   中英

java.lang.NullPointerException when launching Eclipse

I'm using Eclipse Juno and I get this error when I launch it on a certain workspace:

An error has occurred. See error log for more details.

java.lang.NullPointerException

Other workspaces that are checked out from the same SVN repository work well. Does anyone know why this might happen?

In the workspace log, I get the following exception:

.ENTRY org.eclipse.m2e.logback:appender 4 0 2014-03-11 13:26.25.798 !MESSAGE Could not add repository index

.ENTRY org.eclipse.ui:workbench 4 2 2014-03-11 13:26.37:470.MESSAGE Problems occurred when invoking code from plug-in. "org.eclipse.ui.workbench". .STACK 0 java.lang.NullPointerException at org.tigris.subversion.subclipse.ui.history:SVNHistoryPage$2.getElements(SVNHistoryPage.java.631) at org.eclipse.jface.viewers:StructuredViewer.getRawChildren(StructuredViewer.java.1010) at org.eclipse.jface.viewers:ColumnViewer.getRawChildren(ColumnViewer.java.703) at org.eclipse.jface.viewers:AbstractTableViewer.getRawChildren(AbstractTableViewer.java.1087) at org.eclipse.jface.viewers:StructuredViewer.getFilteredChildren(StructuredViewer.java.917) at org.eclipse.jface.viewers:StructuredViewer.getSortedChildren(StructuredViewer.java.1067) at org.eclipse.jface.viewers:AbstractTableViewer.internalRefreshAll(AbstractTableViewer.java.701) at org.eclipse.jface.viewers:AbstractTableViewer.internalRefresh(AbstractTableViewer.java.649) at org.eclipse.jface.viewers:AbstractTableViewer.internalRefresh(Abstrac tTableViewer.java.636) at org.eclipse.jface.viewers:AbstractTableViewer$2.run(AbstractTableViewer.java.592) org.eclipse.core.runtime.internal.adaptor:EclipseAppLauncher.runApplication(EclipseAppLauncher.java.110) at org.eclipse.core.runtime.internal.adaptor:EclipseAppLauncher.start(EclipseAppLauncher.java.79) at org.eclipse.core.runtime.adaptor:EclipseStarter.run(EclipseStarter.java.353) at org.eclipse.core.runtime.adaptor:EclipseStarter.run(EclipseStarter.java.180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect:NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java.39) at sun.reflect:DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java.25) at java.lang.reflect:Method.invoke(Method.java.597) at org.eclipse.equinox.launcher:Main.invokeFramework(Main.java.629) at org.eclipse.eq uinox.launcher:Main.basicRun(Main.java.584) at org.eclipse.equinox.launcher:Main.run(Main.java.1438) at org.eclipse.equinox.launcher:Main.main(Main.java:1414)

解决:清理我的.metadata文件夹并在eclipse中重新导入项目

For me, the below steps works.

Right click on project > Select Run As > Run Configurations Click on Select Other link next to Using VisualVM Launcher Select Eclipse EDT launcher Click ok

If you are installed Hiber object in your eclipse and when you are creating a new project as like vaadin 8 project then showing that notification. go to your eclipse market place search hiber object and expand the update/installed button then click uninstall and follow that instruction.

For me I changed the system variable "java_home" to work with other software and that caused eclipse to show that error. after changing it back to the original directory I was able to launch eclipse without any issues.

so for those who don't want to take risk losing something I would recommend checking if the "java_home" variable didn't change or even got deleted.

simply do the following:

  • click on the window logo or search bar if it is enabled.
  • write "variable" .
  • you see "Edit the system environment variables" .
  • click on "system variables" and if you don't see it check if you are in "advanced" tab.
  • you can see two spaces "user variables" and "system variables" check if you can see "java_home" or "JAVA_HOME" .
  • if you don't then just add it and if you do see it check the value if it points to the right directory of your JDK .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM