Eclipse does not show Java Application run configurations - java

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...

Related

Can you force eclipse to run/debug another project when a particular one is ran/debugged?

I'm working with Ligdx, an API for cross plattaform game development that by default generates at least 2 projects:
The core project: This is the one you are supposed to work on, where all the classes and logic should be placed.
The desktop project: This one is automatically generated from the core project.
The core doesn't have any class to start it because it's supposed to be started from the desktop (or other platforms) project.
It is also always selected -because its what you are working on- so pressing the "run" or "debug" buttons will attempt to run the core project and not the desktop one and immediately fail thus forcing you to select the desktop project before hitting run/debug. This can get extremely annoying, especially when debugging.
So is there a way to force Eclipse to always run the desktop project?
Rekaszeru's answer to this question shows how to set up Eclipse in order to always launch the previously launched application.
You simply have to go to preferences / run-debug / launching and check the "Always launch previously launched application" box as he shown in the picture he used to illustrate his answer:
This will not force one of the projects to always be launched but it would pretty much solve the problem unless you are working on multiple projects at the same time or you alternate between Web/Android/Desktop.
If Your asking how to start a Core project from already existing project present in the eclipse then all you need to do is Right Click on desktop folder of the project and go over Run As and select Java Application
But if that is not what you have posted for I can only understand that you need to understand how a LibGDX project is deployed.... From Desktop project "In xyzMain.java" file you will have a method call to the core project saying:
new LwjglApplication(new Sample(), cfg);
This is where you'r Sample Class from the core project is called over.
But from the title I get a diff feeling that you wish to add another project to your already existing project...
You can do that by changing the build Path of the project....by including Other proj to the one you wish to compile and run.
Hope this helped you out..
I´m not aware of doing exactly what you have described, but I´d suggest using the Launch Configurations menus and dialgos to do what you want in a similar quick way.
Note that you can configure your launch configurations doing: Run -> Run Configurations... (also Run -> Debug configurations...)
Option 1).
Once you have run your Desktop Project, simply use the Run Drop-down button, which contain your launch configurations:
Option 2).
Save a launch configuration file in your Core project (or wherever you want) using the last "common" tab of the launch configuration dialog:
Then you can simply right-click on your that file to launch your Desktop Project:
P.S: I´d also suggest reading a little bit about run configurations in lars tutorial

Stanford CS106a: some java applet errors that do not allow to run the programs

Wasnt able to solve the problems in this screen.
http://s8.postimage.org/n5osf76ed/qestions.jpg
All the code worked a month ago.
What have I changed: I have a different version of eclipse (now: Eclipse IDE for Java Developers 1.5.1.20120920-0737, don't know what the previous one was).
Messed with environment variable. Since this does not effect the ot
Please help.
Try this solution mentioned in this discussion.
I just ran into this problem using standard (not Stanford) Eclipse.
By now this is probably moot for you, but I'll post my solution for
future travelers.
The launch configurations for Assignment 1 default to Applet, so the
containing Karel application isn't launched. To solve this, create
and use new Application launch configurations for each file.
If you already tried to run some of the files, delete the Applet
configs created so you can reuse the names:
Open the project properties (e.g. right click on Assignment 1 and select Properties).
Select Run/Debug Configurations.
Select and Delete each configuration.
Click OK.
May the Force be with you.
Create Application configs:
Right click on java file (e.g. CollectNewspaperKarel.java) and select Run As > Run Configurations...
Select Java Application in the left pane.
Click New Launch Configuration (the icon of a document with a +).
Type a name for the configuration and set its Main class to the associated file (e.g. CollectNewspaperKarel).
Click Apply then Run. (This should run correctly and create a useful entry in the Run History.)
Eclipse will still try to default to Applet, so you will henceforth
need to launch these configurations from the Run History (either from
the Run menu or the pull down on the run button). If you accidentally
launch as default, it will add a useless Applet configuration to the
Run History (e.g. CollectNewspaperKarel (1) ). You can delete this
from the Run Configurations dialog to keep the Run History tidy.
The eclipse used in CS106A is customized for stanford and for "karel the robot" :)
Just download and install it again and things should work just fine.

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.

Make eclipse debug my android PROJECT

I am writing an Android application using Eclipse. When I click on the project in the left tree view and then click debug, the IDE builds an APK and installs in the emulator / device as expected.
However, if I'm editing a file and forget to first click on the project before attempting to debug, the IDE thinks I want to debug that specific Java file. This is NOT what I want to do, I would like it to build and emulate / install on device as usual.
Is there any way to change this behavior in Eclipse?
In eclipse, you can set in workspace preferences / run-debug / launching to always launch the previously launched application (until you explicitly choose an other application: then it will be the last that will be launched).
This way, no matter where you press (ctrl)F11 or click the debug/run button, the launch configuration you used the last time will be called again.
You will still be able to launch different applications of course, by explicitly calling their launchers (the way you debug now).
The procedure you are using (clicking on the project and selecting Debug as => Android Application is OK, for the first debug session (resp. Run as, non debug).
If you want to debug the app again (regardless of what is selected in the left hand side navigator), you should just click on the Green Run circular icon (or rather on the small > sign on its right side if you want to select a different run configuration) or the little bug on its left (for debug).
If you click on one of the > you will select on of the 8 last run/debugged app. If you are sure that the last one is the one you want to run again, then just press one of these two icons (bug for debug, green arrow for run) instead of the arrows.
When you click on the project and select Debug as what you actually do is configure a default run configuration for this app or class that can be later tweaked through the Run/debug Configurations... to better suit your customisation needs. If you click again, eclipse will detect that it has already generated a default configuration (and will not create a new identical one). Alternately you can directly create your new Run/Debug config directly through the Run/debug Configurations... sub menu.
Since the ADT plugin shipped by Google does not include a Run as... Android Application submenu when you click a java class under an android project, the default launch configuration is the java application or the server application (static main method absent).
Update
To clarify things a bit. What you ask (running your android app whilst having the java class selected in the package explorer is possible). What happens when you press the 'small bug' icon does not depend on what is selected in any navigator.
The "default launch configuration" is poorly phrased.
Let me describe what happens in more detail. When you right-click on a java class say in the package explorer (or the project explorer for Java EE version) eclipse (the navigator) calls all contributions (plugins) having registered a handler for that event and lists possible candidates in a sub menu.
In a standard Java EE eclipse installation you will see at least the run on server option and if the class has a main static method with string array arguments, you will also have a the runs as ... java application option. In both cases, eclipse will generate for you a "launch configuration". These launch configurations (both debug and non debug) are all available in the launcher dialog boxes (accessible via the icons described above). They have a lot of different configuration options depending on their nature (for instance whether you debug on a server or a simple java app or an applet). What I termed the "default configuration" is that for each of this launch configuration categories, eclipse will leave these options empty.
So the first time, you will select the Android project and select the run as... Android application option. This will create a default configuration. In ADT's case, the default configuration will also probably select a default ADV and launch it (if it's not already launched). And on subsequent occasions, it will be enough to press the run or debug icon to redeploy your app back to your ADV and this will happen regardless of what is selected in the navigator.

Categories

Resources