1

So I'm doing this tutorial but when I try to run my Alfresco maven repo it tells me :

C:\Users\admin\Desktop\tutorial_home\content-tutorial-repo>run.bat    
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap

So I added those lines in my pom.xml :

<plugin> 
   <groupId>org.apache.maven.plugins</groupId> 
   <artifactId>maven-surefire-plugin</artifactId> 
   <configuration> 
      <argLine>-Xmx512m</argLine> 
      <forkMode>pertest</forkMode> 
      <childDelegation>true</childDelegation> 
   </configuration>
</plugin>

But it didn't work.

Moreover, when i try to run.bat, it gives me the error. But then when I try to mvn -version or any maven command it gives me the same error. If I want to execute a mvn command I have to restart my console.

P.S : my mvn -version gives me this, so I think it's ok right ?

C:\Users\admin\Desktop\tutorial_home\content-tutorial-repo>mvn -version
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
Maven home: C:\apache-maven-3.5.0\bin\..
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: C:\Program Files (x86)\Java\jdk1.8.0_121\jre
Default locale: fr_FR, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "x86", family: "windows"

If anyone knows what I should do.. Thanks in advance !

Jack
  • 695
  • 10
  • 29
  • did you give anywhere `MaxPermSize` jvm option in maven settings.xml ? its not supported in java8. also how much free memory is available in your system >? – Amit Apr 28 '17 at 08:53
  • could you show the content of your `run.bat`? there must be somewhere in your configuration writing `-Xms2048m` – Jerry Chin Apr 28 '17 at 08:54
  • @AmitK no I didn't touch these parameters except in my pom.xml as I said earlier and in my environment variables where I put `-Xmx1024M -XX:MaxPermSize=512m` to MAVEN_OPTS – Jack Apr 28 '17 at 09:02
  • @JerryChin there is only this ` :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Dev environment startup script for Alfresco Community :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: @echo off set MAVEN_OPTS=-Xms256m -Xmx2G mvn clean install alfresco:run` – Jack Apr 28 '17 at 09:04
  • can you try removing that from your enviroment variables to maven_opts? – Amit Apr 28 '17 at 09:05
  • 1
    Possible duplicate of [Could not reserve enough space for object heap](http://stackoverflow.com/questions/4401396/could-not-reserve-enough-space-for-object-heap) – Jerry Chin Apr 28 '17 at 09:09
  • @AmitK it doesn't change anything – Jack Apr 28 '17 at 09:11
  • It looks like you are using a 32 Bit JDK which I wouldn't recommend to use for building..only if you really need to...Running with JDK 8 you don't have support for MaxPermSIze anymore... – khmarbaise Apr 28 '17 at 09:14
  • @JerryChin thank you, I'll see if the solutions there work – Jack Apr 28 '17 at 09:25
  • @khmarbaiseI should reinstall JDK with an x64 version then ? – Jack Apr 28 '17 at 09:26
  • @JackA, you can have both the JDK but point to 64 bit in you system environment prop. – Amit Apr 28 '17 at 09:58
  • @khmarbaise I reinstalled JDK x64 and it worked ! Thanks ! – Jack Apr 28 '17 at 11:35

1 Answers1

0

Ok, the problem came from my version of JDK. I reinstalled a x64 version and everything worked better.

Jack
  • 695
  • 10
  • 29