Java 如何在eclipse中同时调试两个项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18395243/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I debug two projects in eclipse at the same time?
提问by Vyacheslav
I have two projects: consle and android project. I want to compare the values of variables because the same code (as I think) gives different results. I have to find the error. If I press the F6 button the state changes just in one project. Is it possible to switch the debugging project on the fly?
我有两个项目:consle 和 android 项目。我想比较变量的值,因为相同的代码(如我所想)给出了不同的结果。我必须找到错误。如果我按下 F6 按钮,状态只会在一个项目中发生变化。是否可以即时切换调试项目?
采纳答案by sergej shafarenka
Put breakpoints in both projects and launch them in debug mode.
在两个项目中放置断点并在调试模式下启动它们。
Switch to "Debug" perspective and find "Debug" viewthere. You will see a list of active debug sessions with their respective call stacks. You can click on every debug step of every debug session and Eclipse will open that step in code editor. "Variables" view will also be updated.
切换到“调试”透视图并在那里找到“调试”视图。您将看到带有各自调用堆栈的活动调试会话列表。您可以单击每个调试会话的每个调试步骤,Eclipse 将在代码编辑器中打开该步骤。“变量”视图也将更新。
回答by Radnyx
In one instance of Eclipse, you can't run two processes at once.
You could have two Eclipses open for each project.
在 Eclipse 的一个实例中,您不能同时运行两个进程。
您可以为每个项目打开两个 Eclipse。
For Android Development, here's some Debugging Documentation: http://developer.android.com/tools/debugging/index.html
对于 Android 开发,这里有一些调试文档:http: //developer.android.com/tools/debugging/index.html
回答by mccxj
it's impossible to do that.
这是不可能的。
Maybe you should take the help of Debug Log, as you say, the code is the same, then the log output should be the same,too.
也许你应该借助Debug Log,正如你所说,代码是一样的,那么日志输出也应该是一样的。
Use Debug(F6) is usually inefficiency.
使用 Debug(F6) 通常效率低下。
回答by FraZer
Open two Eclipse instances that's the only way.
打开两个 Eclipse 实例,这是唯一的方法。
The following link can be of some help-
以下链接可能会有所帮助-
Can you have 2 completely independent instances of Eclipse running at the same time?
回答by Gjerdingen
- Run both projects
- Open console-window
- On the right in the console-window there is a button that says "Display Selected Console"
- Switch between your projects console-windows
- 运行两个项目
- 打开控制台窗口
- 在控制台窗口的右侧有一个按钮,上面写着“显示选定的控制台”
- 在您的项目控制台窗口之间切换