While continuing development of a Java application, I tried opening my GUI classes and I couldn’t get either of them to open up correcty with the Visual Editor. After a few times of restarting Eclipse, nothing was working so I did some exploring on the web and found some forums. A lot of which were not helpful, but I did manage to find the fix within one. Now, I do not know what caused my error, there seems to be nothing wrong with my code and it’s never behaved like this before, but for some odd reason today, the product of attempting to do some Java development was an error,
Visual Editor java.lang.NullPointerException
and the by-product was knowing the fix and having the opportunity to share it with others.
Now I did see in some cases that this didn’t work as the fix, but for my project, it worked perfectly and very fast!
The Eclipse version I’m using is:
- Eclipse IDE for Java EE Developers: 126.96.36.19900217-2310
- Visual Editor: 1.4.0.v20090826-1446-57F-9xKEUXK5__GAVDlmFRiymDdO
To fix this error follow these steps:
- Go to Project. Select Clean…
- You should see a screen like this now.
Simply select the project(s) you’ll want to clean and then press ok. Once the project(s) have been successfully cleaned, restart Eclipse and try it again.
If this fix doesn’t work, you may have another issue that may be related to some part of your code or package dependencies.
Feel free to post any other ideas or comments.