因为我的RCP eclipse应用程序在eclipse之外运行时失败,但在eclipse内部运行时工作正常,我试图使用eclipse远程调试我的应用程序,因为它在eclipse环境之外运行.
我在64位Windows 7机器上使用32位Eclipse 3.6.1.我正在使用32位Java 1.6更新37.我使用Eclipse产品导出向导来打包应用程序,最后我得到了一个eclipse.exe.我创建了一个远程调试配置并将其设置为使用端口8765(随机数).出于调试目的,我使用以下行从命令行启动应用程序:
eclipse.exe -Xdebug -Xrunjdwp:transport = dt_socket,address = 127.0.0.1:8765
根据我是通过Eclipse调试器附加还是监听,我将在这个命令行中添加server = [y/n]选项,但似乎没有任何区别.
对于配置连接类型,我尝试了标准(套接字侦听)和标准(套接字连接).当我尝试Socket Listen时,我的调试器将开始监听 - "等待vm在端口8765连接",但是当我通过命令行启动我的应用程序时,应用程序启动正常,但调试器从不附加.
当我尝试Socket Attach时,我首先使用命令行启动应用程序,然后当我尝试使用eclipse进行附加时,我收到消息"无法连接到远程VM.连接被拒绝"
我已经尝试了所有地址的各种组合:localhost,127.0.0.1和我的本地IP地址.我每次都得到相同的结果.
谢谢你的帮助!
我试图弄清楚为什么以下似乎不适用于Java.
这是基本的抽象类:
public abstract class Shape {
}
Run Code Online (Sandbox Code Playgroud)
让我们说它有两个具体的类,Circle:
public class Circle extends Shape {
}
Run Code Online (Sandbox Code Playgroud)
和Square,它有多个构造函数:
public class Square extends Shape {
public Square(Shape shape)
{
// nothing
}
public Square(List<Shape> shapes)
{
// nothing
}
}
Run Code Online (Sandbox Code Playgroud)
鉴于此代码:
Circle c = new Circle();
List<Circle> cList = new ArrayList<Circle>();
Square s = new Square(c);
Square s2 = new Square(cList);
Run Code Online (Sandbox Code Playgroud)
最后一行产生错误:
The constructor Square(List<Circle>) is undefined.
Run Code Online (Sandbox Code Playgroud)
但我有Square中的构造函数接受参数List<Shape>,而Circle是一个Shape - 采用单个Shape的构造函数很好.所以我不明白为什么我会收到这个错误.谢谢你的帮助.