Eclipse Debug not opening window - java

I have decided to start learning Java. And i have downloaded and is using Eclipse as my code editor. I am also following a tutorial on Youtube and on various sites, and on all of those sites it says that clicking Debug will run your application with live code editing. However, When i press debug my application doesn't launch (i think) but when i click Run, the window shows up and the application is functioning.
So basically what happens when i press Debug is it gives me a list of all currently active Applications, but my application won't open up.
I am on a Mac if it helps

Try right-clicking on an executable file and select Debug As → Java Application. After you have started the application once via the context menu, you can use the created launch configuration again via the Debug button in the Eclipse toolbar.

A complete Debugging tutorial can be found here, will be useful to you.
Eclipse Debugging

Related

Eclipse does not show Java Application run configurations

I am using Eclipse 2018-09 with multiple Java Application run configurations. Below you can see, that I can run them by using the toolbar button. However, in the management view, they are not shown anymore. I already checked the filters. It also says, that it matches all run configurations using the filters at the bottom of the window. I also cannot create a new Java Application run configuration from this view. It simply does nothing when I click the "New launch configuration" button in case Java Application is selected. Any idea besides setting up Eclipse from the ground up (again)?
EDIT: I just downloaded a fresh copy of Eclipse and opened the same workspace. It shows all Java Application run configurations just fine...

Run debugger on javaFX project in android

I am trying to rebuild an old javafx project on android. Currently I am using javafxports to do so. The problem is I can't debug it, this is how the project hierarchy looks:
The application is started from DisplayClient. So far I am able to log messages using the device monitor. Can you please tell me if it is possible to attach a debugger and if it is how? If any further information is needed I would be happy to give it.
You can easily attach a debugger to your IntelliJ IDE while running your app on an Android device.
To debug a JavaFXPorts/Gluon Mobile that you have created using the Gluon plugin for your IDE (NetBeans, IntelliJ or Eclipse), and that you have deployed to the Android device, follow these steps:
1. Create the JavaFX mobile app from your IDE
For that you can use the Gluon plugin for your IDE. Use one of the built-in templates to create your project or go and use one of the many samples available here.
Let's say you use the Single View project. Provide a name and run the app
2. Create the apk
Run the task from the Gradle View Tasks->other->AndroidInstall to create the apk (or on command line run ./gradlew android).
3. Open the app on your device
Make sure the app works on your device, and don't close it.
4. Open Android Device Monitor
Go to <android sdk>/tools and run monitor. On the left, on top you should see the device, and a list of processes. Find your app package name there, select it and see the port it is using for the app (8600).
5. Attach the debugger on your IDE
Finally, go back to your IDE, and attach the remote debugger, with localhost and 8600 port. For the IntelliJ IDE, go to Run->Edit Configurations..., on the upper left click +, select the Remote option, and provide a name (remote debugger), and the port:
6. Run the debugger on your IDE
Click ok to save, add some breakpoint to your code, and now run the debugger.
In this case, I have a breakpoint in the button event handler, so when I click on it, the app halts at the breakpoint:

How to prevent Eclipse+Tomcat from running current class instead of project (Vaadin)

This may well prove to be a simple config change, but I can't seem to find an obvious setting to solve the following problem:
I have a Vaadin project in Eclipse, which is configured to be debugged with Tomcat v6. If I select the top of the project in the project explorer and hit debug, the eclipse browser launches and my web app opens with the following url:
http://localhost:8080/MyVaadinProject/ THIS WORKS
However, if I'm currently looking at a java file (say Myproject.java), Eclipse tries to open the java file at this url:
http://localhost:8080/MyVaadinProject/WEB-INF/classes/com/example/myproject/Myproject.java
Of course, that produces a 404.
Having to deselect/close my java files every time I want to debug is quite tedious. Is there some way to prevent this behaviour in eclipse?
I am on OSX Lion, Eclipse version 3.7.2.
Thanks!
When running the project, instead of highlighting the class file in the Project Explorer, highlight the very base of the project before running.
This is what we want to run anyway, not the class file itself.
Go to
Windows -> Preferences -> Run/Debug -> Launching
There, at the bottom, select "Always launch the previously launched application".
Now you just have to click your project name in the package explorer and do a Run As -> Run on Server once.
After that launch, you will just need to hit the Run Button and your application should always start the way it should be.

WindowBuilder, no Browser

I'm using Eclipse with Google's WindowBuilder. When I run my program, WindowBuild launches my browser and my program is displayed in a web. All very slow.
How do I configure, if possible, WindowBuilder so it does not launch the web browser, similar to how Netbeans runs its programs?
Edit 1:
This is similar to: Can I use WindowBuilder without GWT, but I'm looking for an example or instructions for creating simple non-GWT application.
Click the down arrow near the run button, then click run as and run as a java application. This should not run in your browser.
This may depend on what type of project you have declared your project as.
Try to use the swt package.

Play! Framework Eclipse Debug Source Not Found

I have been trying to debug and look through the internals of Play! Frameworks Controller class. If I place break points on the Controller.class, the debugger stops at the break point but throws a "Source Not Found"
I have added play.jar and the project is in path. Even added a Java Classpath called "Play_Home" which points to the Play framework.
Update
I been able to always debug my code (your solutions don't help me). When I plan a breakpoint on Play's internal classes like Controller, the debugger stops and says "Source not found"
(This answer is almost a straight copy of my own answer to another question that touches the same topic. I assume the problem in your case will be solved by running the eclipsify command, as another user has already mentioned.)
Create the configuration files for Eclipse by running play eclipsify YourProject command. (See Play framework documentation for more information.)
You should now have a folder named eclipse in your project. In it, you should see commands Connect JDPA to YourProject.launch, YourProject.launch and Test YourProject.launch.
Right-click on the YourProject.launch and choose Run As --> YourProject from the pop-up menu. That will start your application. When the application is running, right-click on the Connect JDPA to YourProject.launch, and choose Debug As --> Connect JDPA to YourProject.launch from the pop-up menu. That will start a debug session on your application.

Categories

Resources