I have a problem with a junit
ant build, i'm getting a java.lang.OutOfMemoryError: PermGen space
error.
I'm trying to set ANT_OPTS
to be ANT_OPTS='-Xmx512m -XX:MaxPermSize=256m'
in the build Java Options
to increase the heap size ant build tool.
But i get an error each time i run:
Exception in thread "main" java.lang.NoClassDefFoundError: ANT_OPTS=-Xmx512m -XX:MaxPermSize=256m
Caused by: java.lang.ClassNotFoundException: ANT_OPTS=-Xmx512m -XX:MaxPermSize=256m
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: ANT_OPTS=-Xmx512m -XX:MaxPermSize=256m. Program will exit.
A syntax error ?
Thanks.
Go to Manage Jenkins -> Manage Plugins -> Available and search for Ant Plugin . After it's installed, go back to your job configuration and select a new build step Invoke Ant .
You will need Java installed on your system, version 1.8 or later required. The later the version of Java, the more Ant tasks you get.
To take advantage of the Jenkins Ant plugin, create a freestyle project named 'Apache Ant and Jenkins Build Job Example. ' Run the Jenkins Ant build job and the source code will be pulled from GitHub, the tasks will run, and the application will be compiled, tested and packaged as a WAR file.
Set the JAVA OPTIONS as -Xmx512m -XX:MaxPermSize=256m
only without the ANT_OPTS=
Also, u can add memory option in the build file also, like memoryInitialSize="256m" memoryMaximumSize="512m"
. this will help. as i am using the same, and it caused no problem till now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With