如何使用 jenkins ant 构建工具中的 `Java Options` 来设置 ANT_OPTS [英] How to use the `Java Options` in jenkins ant build tool to set ANT_OPTS

查看:38
本文介绍了如何使用 jenkins ant 构建工具中的 `Java Options` 来设置 ANT_OPTS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 junit ant 构建有问题,我收到 java.lang.OutOfMemoryError: PermGen space 错误.

I have a problem with a junit ant build, i'm getting a java.lang.OutOfMemoryError: PermGen space error.

我正在尝试在构建 Java Options 中将 ANT_OPTS 设置为 ANT_OPTS='-Xmx512m -XX:MaxPermSize=256m'增加堆大小 ant 构建工具.

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.

语法错误?

谢谢.

推荐答案

将 JAVA OPTIONS 设置为 -Xmx512m -XX:MaxPermSize=256m 仅在没有 ANT_OPTS=

Set the JAVA OPTIONS as -Xmx512m -XX:MaxPermSize=256m only without the ANT_OPTS=

这篇关于如何使用 jenkins ant 构建工具中的 `Java Options` 来设置 ANT_OPTS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆