步骤:
1、反注释 JBoss 运行文件中的 JPDA 选项
编辑文件 % Compiere2%\jboss\bin\run.bat(或 run.sh),找到以下行:
rem JPDA options. Uncomment and modify as appropriate to enable remote debugging.
rem set JAVA_OPTS=-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%
删除第二行的 rem,取消注释。
2、在 Eclipse 中,创建一个 Remote Java Application
启动 Eclipse,找到我们的 Compiere 项目。选择 Debug 菜单,如下图:
a. 选择 Remote Java Application 点击 New
b. 点击 Connect
c. 找到你的项目
d. 设置 Host 为 localhost
e. 设置 Port 为 8787
f. 为配置起一个名字,如 Comp251f
3、运行远程调试
. 启动 Compiere 服务 %Compiere2/utils/RUN_Server2.bat
. 在 Eclipse,在 Debug 按钮下选择 Remote Java Application
. 注意 Eclipse 的窗口出现了
. 现在执行你希望调试的 Compiere 代码
. 转到 Java Perspective 窗口,并设置一些财务科目的断点
4、结束远程调试
编辑文件 %Compiere2%\jboss\bin\run.bat,将以下行添加注释:
rem set JAVA_OPTS=-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%
编辑文件 % Compiere2%\jboss\bin\run.bat(或 run.sh),找到以下行:
rem JPDA options. Uncomment and modify as appropriate to enable remote debugging.
rem set JAVA_OPTS=-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%
删除第二行的 rem,取消注释。
2、在 Eclipse 中,创建一个 Remote Java Application
启动 Eclipse,找到我们的 Compiere 项目。选择 Debug 菜单,如下图:
a. 选择 Remote Java Application 点击 New
b. 点击 Connect
c. 找到你的项目
d. 设置 Host 为 localhost
e. 设置 Port 为 8787
f. 为配置起一个名字,如 Comp251f
3、运行远程调试
. 启动 Compiere 服务 %Compiere2/utils/RUN_Server2.bat
. 在 Eclipse,在 Debug 按钮下选择 Remote Java Application
. 注意 Eclipse 的窗口出现了
. 现在执行你希望调试的 Compiere 代码
. 转到 Java Perspective 窗口,并设置一些财务科目的断点
4、结束远程调试
编辑文件 %Compiere2%\jboss\bin\run.bat,将以下行添加注释:
rem set JAVA_OPTS=-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%