NullPointerException from Eclipse Compiler - eclipse

I am receiving the following message from my Eclipse compiler, and my project fails to compile....
Internal compiler error: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.missingTypeInMethod(ProblemReporter.java:5075)
I've tried updating Eclipse, restarting eclipse, closing and opening the project, refreshing, cleaning/rebuilding, etc. I'm out of ideas.

That seems to be the bug 250297, fixed in eclipse 3.4.2. Also fixed in the 3.5 (M4, November 2008, as mentioned in this JDT release notes)
The failure occurs on line (>>>):
public void missingTypeInMethod(MessageSend messageSend, MethodBinding method)
{
List missingTypes = method.collectMissingTypes(null);
>>> TypeBinding missingType = (TypeBinding) missingTypes.get(0);
It would indicate that though we identified a missing type (which we try to complain against), we fail to locate it inside the method signature...
So... if you are using an "older" version of eclipse (like 3.4, or 3.4.1), a good solution is to upgrade (that is, install another fresh version of eclipse, 3.4.2 or 3.5.1), while reusing your same workspace.
The error should then go away.

I had this problem as late as Eclipse Luna (4.4). The only way I found to get rid of it was to upgrade to Eclipse Mars (4.5.0). I don't know if this is relevant to the issue, but I upgraded to java 8 shortly before the problem arose.
HTH.

Related

javafx Eclipse Mars install

I have just installed eclipse Mars (4.5) and I have a problem with one old JavaFx project. Before installing Mars, I was using Luna and got no problem with my JavaFx projects, now I have the following problem with one project, all the javafx code are underlined with a similar error:
Access restriction: The type 'LineChart' is not API (restriction on required library 'C:\Program Files\Java\jre1.8.0_45\lib\ext\jfxrt.jar')
I do not know what it means, I tried to refresh the project and reboot Eclipse but the errors do not disappear, I can run my application without any problem though. I have other JavaFx project but none got this error.
I am using the latest JDK 1.8 update 45.
I solved my problem by removing JavaFX SDK from the build path and adding it again. I don't understand why it did not work the first time.

Eclipse Luna crashes on new project in Ubuntu

I'm having some trouble getting Eclipse Luna to work. I downloaded the tar.gz from the eclipse site and I downloaded the tar.gz for the Java JDK. I extracted everything and Eclipse opens properly, but when I try to make a new project, it crashes on me. In the terminal I ran java -version and it tells me I have version 1.8.0_25 so I don't think I have an issue with java. Now, this happens if I try to make any kind of project. Eclipse opens the wizard for creating a new project of a particular type and then the whole application crashes. When I started doing this, I installed it under the KDE desktop. When Eclipse crashes, I get the message java: /build/buildd/gtk2-engines-oxygen-1.4.5/src/animations/oxygencomboboxdata.cpp:87‌​: void Oxygen::ComboBoxData::setButton(GtkWidget*): Assertion '!_button._widget' failed. So, I decided to install the xfce desktop to get around it, since oxygen is a KDE theme. I uninstalled eclipse and reinstalled it under xfce and I have the same behavior and the same errors. When I run eclipse from the command line, I get this exception on startup:
java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String
at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26)
at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189)
at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144)
at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107)
at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Does anyone have any ideas on what else to try?
According to comment 20 in this bug report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=440660#c20
This seems to be a bug in GTK according to
https://bugs.launchpad.net/ubuntu/+source/gtk2-engines-oxygen/+bug/1242801
(there a similar problem for Meld was reported).
Another workaround mentioned there is for Oxygen, edit the normally already existing file
/usr/share/themes/oxygen-gtk/gtk-2.0/gtkrc and change
`GtkComboBox::appears-as-list = 1`
into
`GtkComboBox::appears-as-list = 0`
This workaround is working for me.
I have resolved this issue by installing package gtk2-engines-oxygen built for Ubuntu Vivid Vervet (version 1.4.6):
http://packages.ubuntu.com/vivid/gtk2-engines-oxygen

Eclipse won't switch workspace

Whenever I switch workspace on eclipse, I get the error:
An internal error occurred during: "Initializing Java Tooling".
Duplicate field name&signature in class file org/eclipse/jdt/internal/compiler/ast/ASTNode
If I restart Eclipse, it then loads the new workspace correctly. Any ideas how I go about fixing this?
I'm using Eclipse Kepler on Windows 7
Yup, whoops, lombok bug. Sorry. It's been fixed; the next lombok version (looks like that'll be 1.14) will no longer have this issue. Until then, the edge release can be used if this is really cramping your workspace-switchin' style :)
http://projectlombok.org/download-edge.html
Install the latest version of projectlombok.
I had the same issue. After updating Gradle and anything else that I had installed in Eclipse, it still wouldn't work. For me it actually wouldn't be fixed by restarting Eclipse, as far as I could tell. I managed to fix it by downloading the latest release of Eclipse and extracting it over my current installation. Don't know if that'll work for you or not.

eclipse 3.7.1 update error

I'm currently using the Eclipse Indigo 3.7 IDE for Java Developers.So today I tried to update it to the latest 3.7.1 but during the update process a error downloading0 with Comparison method violates its general contract! pops out and the whole update process stucks at that process. Can someone help me with this problem?
I'm using both JDK 7x64 and JRE 7x64
Due to lack of information, I can suggest it's related to eclipse bug 317785, if you are using Java 1.7.
Possible workarounds:
* use JRE6
OR
* when using JRE7, theres a small rarely documented feature
set system property java.util.Arrays.useLegacyMergeSort=true
This should use old implementation and should not bring up the bug
I was able to fix this problem by using this workaround taken from the link suggested by 4e6 and VonC (bugs.eclipse.org/bugs/show_bug.cgi?id=317785):
To clarify comment #22 for those on JRE7 who can't upgrade to 3.7.1
because of this bug:
Add the following line to your eclipse.ini:
-Djava.util.Arrays.useLegacyMergeSort=true Then run the update to 3.7.1 from inside Eclipse again, it should succeed now. Afterwards, you should be able to drop that line from eclipse.ini again.

Eclipse randomly exits after installation of Blackberry plugin/SDK

Since adding the Blackberry Java classes from their website into eclipse, I've had it where eclipse will randomly close, with no discernible pattern, rhyme, error or reason. Here is the environment/software packages that I am using:
Windows XP SP2
Eclipse v3.5.1
Blackberry Java Plugin v1.1.1.200911111641-15
Blackberry Java SDK 4.5.0.21
I've tried the usual steps of complete uninstall and reinstallation of Eclipse and the accompanying plugins on multiple systems with the same configuration, including one that had a fresh install of Windows XP SP2. Upgrading to Eclipse 3.6 didn't work (the plugin wont' install as it's the wrong version), nor the downgrade to 3.4 for the same reason. I also increased the heap size to 512 (system has two gigs of memory) as some research into Eclipse doing this type of thing with Groovy was resolved that way, but again, no dice. Eclipse works great when the blackberry plugins are not installed, and no entries of errors or issues in the event log are helping to show what the issue with these plug-ins might be.
So if anyone has ran into this issue, and even better, has a solution, I'd love to hear about it. Thanks in advance.
EDIT: An additional to my issue, autoComplete with the Blackberry SDK seems to make this extremely unstable, like almost a guaranteed crash. Is this fixable at all?
For anyone that loads this question up trying to find a solution, I've never found a fix. It seems to be a bug with this version of the IDE. If there is a fix, please post.
Did you try to downgrade Eclipse to 3.4 (Ganymede)? I experienced similar issues when I tried upgrading Eclipse to something greater than 3.4.2.
I think the problem is with the plugin, not the IDE. Eclipse has always been stable for me until I installed the BB plugin. Since then it crashes all the time. Since I've installed the release (non-beta) version of the plugin that was recently released I can't even get my project to build.
This could be a manifestation of this bug in Eclipse. Check your C:\eclipse directory for files like hs_err_pidxxxx.log. The file goes on to explain this error:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x753ba053, pid=3144, tid=5820
#
# JRE version: 6.0_20-b02
# Java VM: Java HotSpot(TM) Client VM (16.3-b01 mixed mode, sharing windows-x86 )
# Problematic frame:
# C [USP10.dll+0x1a053]
I've been experiencing this as well. It's completely debilitating. It causes Eclipse to just up and crash out of nowhere (and programming in a language as verbose as Java without Content-Assist is insane).
The bug has been fixed in Eclipse 3.6M7, but unfortunately I can't get the JDE Plug-in to install in the latest release candidate.
This is a known issue with Eclipse 3.5.X and has been fixed for 3.6.0
Bug Ticket link on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=283503
Looks like we are stuck with this until the next update to the BB Eclipse plugin.