我正在尝试在我的终端中构建一个 Java 应用程序(我正在使用 Eclipse,但终端只是为了查看它是否有效),并且我一直卡在这个消息中:
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"
建议我将这行代码添加到我的 .profile 中(我有一个 .bash_profile,但没有 .profile),所以我做了:
MAVEN_OPTS="-XX:MaxPermSize=512m"
但我仍然收到错误消息。这是我的 .bash_profile 文件的样子:
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
MAVEN_OPTS="-XX:MaxPermSize=512m"
export JAVA_HOME=/usr/lib/jvm/java-7-oracle
export PATH=$PATH:/usr/local/mysql/bin
##
# Your previous /Users/tom.maxwell/.bash_profile file was backed up as /Users/tom.maxwell/.bash_profile.macports-saved_2013-03-04_at_15:51:37
##
# MacPorts Installer addition on 2013-03-04_at_15:51:37: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
##
@
".bash_profile" 46L, 1730C
我应该怎么办?我要运行的应用程序很大,而且我对 Java 不熟悉(我主要是 JS/CSS 人)。