Run MVN package, error:
Invalid maximum heap size: -Xmx512m.Error: Could not create the Java Virtual Machine.Error: A fatal exception has occurred. Program will exit.
Workaround One:
Alter Jvm.config in. MVN directory (it was in Controller directory). Study mvn.sh that comes with Maven. You'll see maven_opts setting in the script. Try out java-version before altering. Eg: java-xmx512m-version Now what know how to go about and make the changes.
Workaround Two:
You can try to set the initial heap size and initial permgen size relatively small, but set the proper Max Heap and Pergen T via-xms128m-xmx1024m-xx:permsize=128m-xx:maxpermsize=256m
Also don ' t set PermGen to 512-it's too much for typical scenarious.
Also want to use fork option with Maven and start plugin execution in different JVMs at all.
For example
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.5.1</version> <configuration> <fork>true</fork> </configuration> </plugin>
Also, while allocating memory Also make sure and that's the much free memory available.
"Invalid Maximum heap Size" when running Maven