Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Netbeans does not have enough memory to compile

Tags:

java

netbeans

Currently Im doing my FYP for my bachelors degree.

I'm using Netbeans 7.2.

Just now I got a message saying that "not enough memory to compile" when I run the project, it loads the main GUI of my application, but when I clicked the menu items, following error appears.

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: PreProcessing/Segmentation

Preprocessing and Segmentation are classes in my project

Can I fix this by reinstalling Netbeans and open this project again?

like image 259
buwaneka Avatar asked Nov 04 '22 12:11

buwaneka


1 Answers

First, press shift-f11 to do a clean build. Pay attention to the output window to make sure that everything compiles OK.

If it does, then right click on your project in the projects window (on the left by default), and select properties. Next select Run on the left. Then in the dialog on the right in the VM Options field, enter something like -XMx 512M. This will tell the JVM running your process to limit its memory usage to 512 megabytes. Pick a higher or lower number as you see fit. Do not pick a larger number than you have RAM on your machine.

Then try running your project.

like image 146
Bill Avatar answered Nov 08 '22 13:11

Bill