MyEclipse14热部署

来源:互联网 发布:网络诈骗案证据不足 编辑:程序博客网 时间:2024/05/21 17:33

一般项目如果有个几百兆大小,启动时间都有点可观了,如果没有热部署,你将会耗费很多时间在启动项目上。
由于我的热部署是用第三方jar,所以我介绍的也是第三方jar的配置,当然每个人的环境不同,配置可能有差异。

配置准备:
jrebel.jar[点击下载]
myeclipse 14 GA

首先,我们将jar包放到我们的D或则E,F盘里,最好先建个文件夹,放文件夹里。如:E:\jrebel\jrebel.jar

然后打开MyEclipse,选择window->MyEclipse->Server->Tomcat7->jdk,(我用的是Tomcat7) 如图1:

参数如下:
-noverify -javaagent:E:\jrebel\jrebel.jar 热部署jar的路径
就这样就可以启动Tomcat了,如果启动时报如下错误 图2:(我用上面配置准备里的jrebel.jar时出现这个错误,如果你使用的是其它版本的,可能不会出现这个错误)
这里写图片描述
如果报了上图的错误,就把Add后面的那串复制下来,贴到配置里,如图1里那样:
-Xbootclasspath/p:”C:/Program Files (x86)/Apache Software Foundation/Tomcat 7.0/temp/rebelboot.jar”
这里要注意,如果你使用的是安装版Tomcat,那么你可能安装到Program Files 或Program Files (x86)里,但是注意这个文件夹是有空格的,如果直接写入会报错。会报:错误: 找不到或无法加载主类 Files的错误。
所以我加了”“,给整个路径加,加了后就可以正常启动了。出现下面的输出信息就表示成功了。
2017-05-10 23:36:12 JRebel: WARN You are running JRebel using the -javaagent option on a system where -agentpath is supported.
2017-05-10 23:36:12 JRebel: Starting logging to file: C:\Users\chenxh.jrebel\jrebel.log
2017-05-10 23:36:12 JRebel:
2017-05-10 23:36:12 JRebel: #############################################################
2017-05-10 23:36:12 JRebel:
2017-05-10 23:36:12 JRebel: JRebel Agent 7.0.2 (201612201618)
2017-05-10 23:36:12 JRebel: (c) Copyright ZeroTurnaround AS, Estonia, Tartu.
2017-05-10 23:36:12 JRebel:
2017-05-10 23:36:12 JRebel: Over the last 1 days JRebel prevented
2017-05-10 23:36:12 JRebel: at least 38 redeploys/restarts saving you about 1.5 hours.
2017-05-10 23:36:12 JRebel:
2017-05-10 23:36:12 JRebel: Licensed to sunjumper (sunjumper@163.com)
2017-05-10 23:36:12 JRebel: with the following restrictions:
2017-05-10 23:36:12 JRebel: cracked by (sunjumper@163.com)
2017-05-10 23:36:12 JRebel:
2017-05-10 23:36:12 JRebel: License type: perpetual
2017-05-10 23:36:12 JRebel:
2017-05-10 23:36:12 JRebel:
2017-05-10 23:36:12 JRebel: #############################################################
2017-05-10 23:36:12 JRebel:
2017-05-10 23:36:13 JRebel:
2017-05-10 23:36:13 JRebel: A newer version ‘7.0.8’ is available for download
2017-05-10 23:36:13 JRebel: from http://zeroturnaround.com/software/jrebel/download/
2017-05-10 23:36:13 JRebel:

注意:如果你使用的是解压版,绿色版的tomcat,那么是没有Apache Software Foundation/Tomcat 7.0/temp/rebelboot.jar 这个rebelboot.jar包的,至少我的绿色版Tomcat里没有,如果配置绿色版热部署失败,那么你可以试试下个rebelboot.jar放到这个文件夹里。

0 0
原创粉丝点击