Java Netbeans 没有足够的内存来编译
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13102241/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java Netbeans does not have enough memory to compile
提问by buwaneka
Currently Im doing my FYP for my bachelors degree.
目前我正在为我的学士学位做我的 FYP。
I'm using Netbeans 7.2.
我正在使用 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.
刚才我在运行项目时收到一条消息说“没有足够的内存进行编译”,它加载了我的应用程序的主GUI,但是当我单击菜单项时,出现以下错误。
Exception in thread
"AWT-EventQueue-0" java.lang.NoClassDefFoundError: PreProcessing/Segmentation
Preprocessing and Segmentation are classes in my project
线程异常
"AWT-EventQueue-0" java.lang.NoClassDefFoundError: PreProcessing/Segmentation
预处理和分段是我项目中的类
Can I fix this by reinstalling Netbeans and open this project again?
我可以通过重新安装 Netbeans 并再次打开这个项目来解决这个问题吗?
采纳答案by Bill
First, press shift-f11 to do a clean build. Pay attention to the output window to make sure that everything compiles OK.
首先,按 shift-f11 进行干净的构建。注意输出窗口以确保一切编译正常。
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.
如果是,则在项目窗口(默认位于左侧)中右键单击您的项目,然后选择属性。接下来选择左侧的运行。然后在 VM 选项字段右侧的对话框中,输入类似-XMx 512M
. 这将告诉运行您的进程的 JVM 将其内存使用量限制为 512 兆字节。选择您认为合适的更高或更低的数字。不要选择比机器内存还大的数字。
Then try running your project.
然后尝试运行您的项目。
回答by buwaneka
I still dont know the reason this happend but i fix this issue. what i did was coppy the project folder to another location and open it from netbeans again and it works fine now.
我仍然不知道发生这种情况的原因,但我解决了这个问题。我所做的是将项目文件夹复制到另一个位置并再次从 netbeans 打开它,现在它工作正常。