- 浏览: 172468 次
- 性别:
- 来自: 北京
最新评论
-
chainhou:
sunshineman 写道maven 编译不过啊,连不上ec ...
jetty的下载,编译,安装等 -
sunshineman:
maven 编译不过啊,连不上eclipse的proxy
jetty的下载,编译,安装等
maven mvn运行出错
- 博客分类:
- 常见问题
今天在buildGlassFish源码时出现错误,后来在mvn后加上 -X,打印出详细信息出如下:
转到相应的wiki页查看,原因如下:
1. You are building a very big multi-module project, each module requires a certain amount of memory so with increasing number of modules the amount of required memory increases as well until the JVM finally runs out of "Java heap space".
2. You are using some plugins that perform memory-intensive operations like analyzing the class files of all project dependencies.
3. You are using the Maven Compiler Plugin with the option fork=false (default) and your project has a lot of source files to compile. When using the Java compiler in embedded mode, each compiled class will consume heap memory and depending on the JDK being used this memory is not subject to gargabe collection, i.e. the memory allocated for the compiled classes will not be freed. The resultant error message typically says "PermGen space".
Fixing this error is usually just a matter of assigning more memory to the JVM. If you run from the command line, this can be done by means of the environment variable MAVEN_OPTS. This variable can be used to specify options for the JVM itself. In case of "Java heap space", the option of interest is -Xmx, in case of "PermGen space" it's usually -XX:MaxPermSize. For example, on Windows you would use
set MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=128m
设置后再次运行mvn ,可能正常执行了。
[INFO] Scanning for projects... [ERROR] Java heap space -> [Help 1] java.lang.OutOfMemoryError: Java heap space at org.apache.maven.model.Dependency.clone(Dependency.java:204) at org.apache.maven.model.DependencyManagement.clone(DependencyManagemen t.java:67) at org.apache.maven.model.ModelBase.clone(ModelBase.java:190) at org.apache.maven.model.Model.clone(Model.java:260) at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultMode lBuilder.java:279) at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultMode lBuilder.java:232) at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBu ilder.java:410) at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBu ilder.java:379) at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBu ilder.java:495) [ERROR] [ERROR] [ERROR] For more information about the errors and possible solutions, please rea d the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/OutOfMemoryErr or
转到相应的wiki页查看,原因如下:
1. You are building a very big multi-module project, each module requires a certain amount of memory so with increasing number of modules the amount of required memory increases as well until the JVM finally runs out of "Java heap space".
2. You are using some plugins that perform memory-intensive operations like analyzing the class files of all project dependencies.
3. You are using the Maven Compiler Plugin with the option fork=false (default) and your project has a lot of source files to compile. When using the Java compiler in embedded mode, each compiled class will consume heap memory and depending on the JDK being used this memory is not subject to gargabe collection, i.e. the memory allocated for the compiled classes will not be freed. The resultant error message typically says "PermGen space".
Fixing this error is usually just a matter of assigning more memory to the JVM. If you run from the command line, this can be done by means of the environment variable MAVEN_OPTS. This variable can be used to specify options for the JVM itself. In case of "Java heap space", the option of interest is -Xmx, in case of "PermGen space" it's usually -XX:MaxPermSize. For example, on Windows you would use
set MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=128m
设置后再次运行mvn ,可能正常执行了。
发表评论
-
java
2014-05-26 17:36 0http://hi.baidu.com/jiajiajava ... -
JAVA中的线程状态都有哪些?
2014-05-04 10:38 0经常会遇到这样的问题,JAVA中的线程都有哪些状态? 通过du ... -
java.lang.IllegalStateException: The request associated with the AsyncContext ha
2013-12-27 11:09 5516在使用Servlet3.0的异步特性时,免不了会遇到下面这个异 ... -
The display name was defined in multiple fragments with different values includi
2013-12-06 11:13 3227在使用Servlet3.0的新特性中关于WebFragment ... -
java.lang.IllegalStateException: Not supported.at org.apache.catalina.connector.
2013-12-04 14:30 3911在使用Servlet3.0的异步特性的时候,经常会遇到如下异步 ... -
java中出现的ConcurrentModificationException产生原因,解决方式及其它
2013-08-23 14:55 1291JAVA开发中有时会出现ConcurrentModificat ... -
windows中有用的查找端口占用的命令
2013-07-19 15:43 1078在windows中可以使用如下命令,查看端口昌被哪个程序占用。 ... -
ClientCommunicatorAdmin restart/Checker-run 等异常的处理
2013-07-15 19:32 3785在做JMX相关的开发过程中,下面这个异常一个会遇到: 20 ... -
Apache启动异常:apache service unable to open logs
2013-07-04 15:09 7400当启动Apache时,如果弹出窗口提示引用unable to ... -
VBox异常退出后,不能启动问题的解决办法
2013-06-26 15:01 6677今天把VBox中的进程强制停止后,启动VBox的时候,Ubun ... -
InetAddress.getLocalHost().getHostAddress()获取的IP不正确
2013-06-09 17:43 10440今天把在Windows下运行很正常的程序拿到Linux下测试, ... -
获取JVM的所有可选参数
2013-05-30 17:54 918使用如下命令可以列出所有java可选的参数 java -XX: ... -
在windows中获取某个进程的具体执行路径
2013-05-20 17:55 2226经常遇到要处理某类问题,知道某个具体进程,但是却不知道真正的执 ... -
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is
2013-05-08 17:49 2774今天在学RMI的时候遇到了这个问题: java.rmi.Un ... -
java中的toString()和(String)obj的区别
2013-04-22 18:07 1669java中的toString()和(String)obj的区别 ... -
Struts2 Dispatcher initialization failed No mapping found for dependency default
2013-04-10 16:41 1153在struts2的使用时如果发现以下异常信息, 严重: D ... -
java debug
2013-03-27 06:46 8651、 条件断点 断点大家都比较熟悉,在Eclipse Jav ... -
Java远程调试 java -Xdebug各参数说明
2013-03-27 06:43 11539首先,JAVA自身支持调试功能,并提供了一个简单的调试工具-- ... -
jdk Logger引起的NullPointerException
2013-03-25 18:22 972我们平时调用JDK的log来记录日志,都会习惯拿到一个logg ... -
对于应用服务器中的虚拟主机设置别名后,使用别名访问应用
2013-01-21 17:36 1455对于应用服务器中的虚拟主机设置别名后,使用http://别名 ...
相关推荐
Storm编程实践(安装Maven-使用Maven编译运行代码-mvn 打包)
遍历文件夹及子文件夹下得pom文件,自动清理、编译、安装。适合批量编译多个maven工程
建造吊索-cq 使用 maven mvn 和 sling 到 CRX 从 SVN 源构建 CQ 包指示将此存储库作为子文件夹克隆到 src 目录的根目录中(如果要克隆,git clone 应该自动执行此操作) 将 settings.json 配置为指向包含您希望 ...
Dockerfile Maven现状:成熟在这一点上,我们还没有开发或接受新功能,甚至没有修复非关键的错误。 这个Maven插件将Maven与Docker集成在一起。 设计目标是: 不要做任何幻想。 Dockerfile是构建Docker项目的方式。 ...
1. mvn-examples-1.0 <module>ch03-simple <module>ch04-custom <module>ch05-simple-web <module>ch06-multi <module>ch07-multi-spring <module>ch08-optimize <module>ch09-pom <module>ch10-lifecycle ...
maven本地仓库
1: 通过配置MAVEN_HOME 和 %% %MAVEN_HOME%\bin 然后进行mvn -version 测试 掌握 -Xms 与 -Xmx的相关配置 2: Maven目录分析: 2.1: bin: 含有mvn运行的脚本 2.2: boot:含有plexus-classworlds类加载器框架 ...
Maven常用命令 Maven Maven学习
解压配置即可,跟配置java差不多,创建系统变量Maven,指向maven的解压,目录,添加到classpath即可,运行cmd 输入 mvn -version 测试即可
使用Maven运行单元测试 将项目安装到Maven本地资源库 生成基于Maven的项目文档站点 使用“mvn site-deploy”部署站点(WebDAV例子) 部署基于Maven的war文件到Tomcat Eclipse创建一个Maven Web项目 在易百教程网...
maven常用指令大全Maven常用命令: 1. 创建Maven的普通java项目: mvn archetype:create -DgroupId=packageName -DartifactId=projectName ...5. 运行测试:mvn test 6. 产生site:mvn site
当前pom.xml中详细的记录了将maven项目打成可运行jar包的完整代码,使用maven的插件maven-assembly-plugin,同时将所有依赖打到jar包中,亲测可用。
MvnRunner 一个用于maven模块的IntelliJ插件,由mvn构建,运行单元测试和主要方法。插件做了什么?针对maven管理的Java项目,添加maven模块内置菜单;在运行和调试两个菜单项上添加maven的处理方式,根据直接调用...
maven权威指南高清版 mvn-examples-1.0.zip MAVEN权威指南对应示例代码
本项目是SpringMVC框架入门配置 IDEA下搭建Maven项目,配置jetty服务,代码简单、完整。可以运行,做完入门的学习
5) Run "mvn --version" to verify that it is correctly installed. For complete documentation, see http://maven.apache.org/download.html#Installation Licensing --------- Please see the file ...
ssm02工程,是用maven管理,是实现用户的登陆和注册以及修改密码,用户登录账号后,可以查看学生的列表,对学生的信息进行怎删改查!绝对可以运行,放心下载
maven.rar apache-maven-3.5.4
-D传入属性参数-P使用pom中指定的配置-e显示maven运行出错的信息-o离线执行命令,即不去远程仓库更新包-X显示maven允许的debug信息-U强制去远程参考更新snapshot包例如mvninstall-Dmaven.test.skip=true-Poracle其他...
Mac的maven安装包apache-maven-3.6.3.zip