How can I make Eclipse/FDT build Main.as instead of the currently selected file? - eclipse

I'm using FDT, and I want Eclipse to build my Main.as file instead of the currently selected file when I click debug/run. Is there a way to do this?

It depends on your settings and the order you've done things...
If you right click on a file and choose 'Run As' or 'Debug As', FDT (Eclipse) will use that file to build your application around.
If you have 'Always launch the previously launched application' enabled (it should be enabled by default) then FDT will always use the last used launch configuration whenever the Run / Debug button is clicked. If none exists then it will run using the currently active file. To enable this setting, go to Preferences > Run/Debug > Launching and look at the bottom where Launch Operations is.
If you have a launch configuration already created, and it sounds like you do, you'll need to adjust the 'Main' file within that launch configuration. Do this by choosing 'Run Configurations...' via the Run button drop down.
I've written a tutorial about this. It should help you get through it.
http://fdt.powerflasher.com/docs/Launch_Configuration_Tutorial

Related

Is it possible to set which file to run by default in eclipse?

I'm writing a python project in Eclipse with the PyDev plug-in, which contains multiple files.
However I'm used to using visual studio, where it'll automatically find the main function of a project and run the program from there.
Eclipse will always run the file I am currently editing (which usually is a file containing function that are called from the main function).
Is it possible to set which file should be run then clicking run? I've looked at the launch options under Project->Properties->PyDev, but didn't find what I was looking for.
When you press the Debug or Run button (Debug on the left) Eclipse tries to intelligently determine what to launch based on your current editor.
You can change the behaviour by editing Window -> Preferences -> Run/Debug -> Launching -> Launch Operation as pictured below.
The default of launching the current editor works well for some languages, but not as well for Python when every single file is itself a valid program to run. In your case I recommend changing to Always launch the previously launched application.
You can create a custom run configuration.
Right click on your project > run as > run configurations
From here is just a matter of choosing your project type on the left hand side and filling in the required information. You can click 'Run' to use your new configuration.
To get to this configuration again, you can click the 'Run' drop down button in the eclipse tool bar and see all of your run configurations.
Hope this helps!

How to remove a configuration in Eclipse GWT

I have migrated my application development to a new PC and now when I run the application (Run > Run as > Web application). I get the "HTML Page Selection" popup in which I select my application. However, now I also get a "Choose a launch configuration:" popup which lists "AwardTracker" and "AwardTrackwer.html". They both do the same thing. How do I remove one of these please (this is more annoying than anything else)?
Regards,
Glyn
How to remove a configuration in Eclipse GWT
Simply select any Web Application and click on RED X icon displayed on top right of it to remove an existing configuration.
Once a Web Application is configured then there is no need to create it again. Just launch it from existing one to avoid it choosing a launch configuration again.
Once configured then don't run it again by RIGHT click on the project to run as Web Application. Simply select from the existing one form the tool bar as shown in below screenshots.
Click Run > Run Configurations > your configuration (typically, a name of your HTML or JSP file) > Arguments.
Make sure you only have the path that you want to launch.

Clearing Eclipse's 'application cache' when performing launch (Run/Debug) for Eclipse Application

I have an RCP project in Eclipse which I launch as an 'Eclipse Application'. After launching and playing with the application, I close it, make some more code modifications and launch again. When I launch the second time, the same changes in the application (tabs opened, fields highlighted...) remain the same as my previous launch. How can I get the Eclipse Application launcher to completely forget my previous run. I am already performing Project > Clean, and running Eclipse with -clean. I would like my 'eclipse application cache' to be cleaned for every run of the code.
On the Run/Debug Configurations dialog, choose the configuration you want to change, go to Main tab, check the Clear checkbox inside Workspace Data group and select the workspace radio button. Uncheck Ask for confirmation before clearing if you wish.

How to forbid creation run configuration in PyDev

Each time I press run button (or using shortcut for it), eclipse creates run configuration in some unpredictable way (looks like it uses currently selected file in PyDev Package Explorer, which is very strange). How to force eclipse to use only manually created run configurations and forbid to creating new one for the current project. I have 'Always launch the previously launched application' checked, but it doesn't help.

How to see what triggered "Build workspace" in Eclipse

My eclipse is constantly running "Build Workspace" tasks. It is not a long running builds, more like 1 build a second.
Sometimes I'd see 10 "Build workspace" tasks sleeping and waiting in the Progress tab.
I'd like to know what is triggering those builds. I have many plugins installed.
What is the way to troubleshoot this?
Here are some steps to help you debug what is going on.
Download the Eclipse Classic SDK for whatever version of Eclipse you are currently using. For Juno that link is here.
Open the eclipse.ini for your current normal eclipse and add the following options: -Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
Start your Eclipse instance that you want to debug, it should pause at the splash screen
Unzip the Eclipse classic SDK and start that Eclipse instance
Open the Plugins view
Find org.eclipse.core.resources
Right click and select "Add to Java Search"
Open Type dialog, type in "BuildManager"
You should see a class from that plugin be given as an option, then open it
Find the line that looks like: prereqs = currentBuilder.build(trigger, args, monitor); It should be about line 728 (For Eclipse Juno)
Set a breakpoint here
Create a new Remote Java Application debug configuration and point to localhost port 8000
Launch this debug configuration
You should see your other Eclipse instance startup
Now every time the Eclipse build manager fires off a build (which should happen on all of those Build Workspace jobs), then you will see this breakpoint be hit and you can find out what builder is firing.
Update 1
If you need source to other Eclipse bundles they can also be added in the "Plug-ins" view. Select all the plugins there and right-click and use Add to Java Search
What plugins do you have installed that are currently active?
Press CTRL+3 type "plugin" and then choose plugin registry.
In the plugin view right click and choose "Active Only"
Check the non-essential core plugins (for example related to servers which automatically build & publish)
Post a screenshot of active plugins if you need any more help
You may have build automatically checked which will build when you save. Check under the nav Project > Build Automatically
Other way to close all unused projects.
Further, for good view, use filtering: View Menu -> filters -> Check 'Closed Project'.
Sometimes if you have > 20 opened projects you can observe constant 'build workspace' tendency.