6

I want to import Spring-framework into IDEA. I followed the document, and run the following command, but I had a error:

spring-framework>gradlew.bat :spring-oxm:compileTestJava cleanIdea idea

Unrecognized VM option 'MaxMetaspaceSize=1024m'
Could not create the Java virtual machine.

What's wrong?

My OS is Win7. JDK version is as following :

>java -version
java version "1.6.0_38"
Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
Java HotSpot(TM) Client VM (build 20.13-b02, mixed mode, sharing)

>javac -version
javac 1.6.0_38
diguage
  • 387
  • 4
  • 19
  • what's you jdk version? – lichengwu Jun 25 '13 at 10:16
  • ``` >java -version java version "1.6.0_38" Java(TM) SE Runtime Environment (build 1.6.0_38-b05) Java HotSpot(TM) Client VM (build 20.13-b02, mixed mode, sharing) >javac -version javac 1.6.0_38 ``` – diguage Jun 25 '13 at 17:57

3 Answers3

9

As @VMN said, MaxMetaspaceSize is supported in Java 8 and have bugs.

You can try one of this:

1)Download JDK8 and set it to you environment.

2)Edit gradlew.bat(windows) or gradlew(linux), remove the VM option MaxMetaspaceSize.

Jason
  • 1,241
  • 8
  • 16
lichengwu
  • 4,277
  • 6
  • 29
  • 42
1

I had the same error. Cause of error is in Java 8 option "MaxMetaspaceSize=1024m", that not supported in early versions. Spring developers use this option in master branch. After switching to the 3.2.x branch project was successfully imported.

VMN
  • 275
  • 2
  • 13
0

You have three choice to slove this problem

1)use JDK8 as your enviroment;

2)ignore or delete "set GRADLE_OPTS=-XX:MaxMetaspaceSize=1024m -Xmx1024m -XX:MaxHeapSize=256m %GRADLE_OPTS%" in gradle.bat;

3)choose another branch like 3.2.x

Baby Groot
  • 4,637
  • 39
  • 52
  • 71