简体   繁体   中英

java.lang.OutOfMemoryError while compiling sling

I'm trying to compile Apache Sling with Maven but I still get this error:

Exception in thread "main"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler i
n thread "main"

I've found that it can be solved by setting MAVEN_OPTS env. variable to this

set MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=512m"

but now I get this error

Invalid maximum heap size: -Xmx512m -XX:MaxPermSize=512m
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

I tried to change it to this

set MAVEN_OPTS="-Xmx512m -XX:MaxPermSize512m"

but the error is same

Thanks for any help

I had the same problem with Windows's command prompt, but when I used cygwin everything successfully compiled. In many examples are used linux commands and I recommend you to use cygwin.

You should use the following commands:

export MAVEN_OPTS="-Xmx256m -XX:MaxPermSize=128m"
mvn clean install -DskipTests

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM