How to see what triggered "Build workspace" in Eclipse - 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.

Related

Include Run Configurations in SVN project in MyEclipse

How can I configure MyEclipse and the SVN plugin (Subclipse 4.3.3) so that my Run Configurations are included in the source code control. Every time a new developer checks out the project, he doesn't have the Run Configurations needed to test the application properly or to do the Maven packaging correctly.
Is there a way?
To share your run/launch configuration, go to the launch configuration (Run > Run Configurations...) tab Common for Save as choose Shared file (instead of Local file).
In addition, you can choose to Display in favorites menu to add it to the drop-down of the corresponding button in the main toolbar.

How is the Eclipse sample project "Multipage Editor" supposed to run?

I installed Eclipse Luna in XP yesterday and opened the sample project "Mutlipage Editor". When I click "Run" all that happens is another copy of Eclipse opens looking like the first copy but all the workspace boxes are empty.
I guess I was expecting either an emulator to start or the ability to run it on my Android phone. Can anyone get me started please?
When you run an Eclipse plugin it has to run in an instance of Eclipse so that all the other plugins that the plugin depends on are available.
The default 'Multipage Editor' is associated with a file type (.mpe I think). So create a file with that type and open it to see the editor.
You can also write an Eclipse Rich Client Program (RCP) where you can select the available plugins and the look of the UI, but this requires additional code.

Worklight v6 - Build Environment and Project Builders

Migrating from Worklight Studio 5.0.6 to 6.0
We observe a small, but undesirable, difference in behaviour, or maybe a confiuguration chenge is needed somewhere we failed to find.
In v5.0.6 when one selects an environment and requests Build Environment and Deploy, the project's Builders are first executed. In v6.0 this does not appear to be the case, unless there's a option somewhere ...
The use case is that we have some pre-processing carried out by an ant task installed as a project builder. In v6.0 we now need to rememeber to run a Build Project and then build the environment.
Is there an option to control this behaviour?
this is how to run ant task in worklight 5.0.x - 6.x:
create the Ant file (build.xml):
Navigate to project->properties->Builders->new->Ant Builder. press ok
in "Main" tab set the name for the builder and choose your Ant file (build.xml):
in "Targets" tab choose when to run the Ant file (in this exemple in Auto Build):
press OK
press OK
run "Build All and Deploy":
Success:
This is an open defect in Worklight 6.0.0.x and 6.1.0.x.
There is currently no workaround for it.

Eclipse "Waiting for virtual machine to exit"

I'm working on a blackberry project using eclipse and bb-ant tools. I've created a build.xml file to perform the build. Everytime I try to run an Ant build, eclipse pops up the progress dialog and it hangs stating "Waiting for virtual machine to exit."
I downloaded an open source Blackberry project that has an ant build and it is showing the same behavior.
Does anyone have any suggestions?
Edit:
I used the command line to build my xml file and it built fine. However, when I tried from Eclipse it still hangs.
I've tried both the standard eclipse plugin directory and the path I downloaded ant to.
You could check if your ANT_HOME settings are correct (see also this blog post).
"Window > Preference > Ant > Runtime": "Ant Home Entries".
if the jars files are from a plugin directory (beside the default 'org.apache.ant_1.7.1.v20090120-1145' one) and not an independent ant installation, that might explain the problem.
Try clicking the "Ant Home" button on the right side and setting up ant home such as "C:\path\to\apache-ant-1.7.0"
There are similar bugs to this kind of situation (bug 173419, ticket 91).
It is worth checking the JVM used for the project.
It can also occurs when a ant task is poorly implemented.
You had the problem because the java version ant tries to run with is incorrect.
By default, eclipse will try to run the ant build with the java version it uses to compile the java files (Blackberry JRE), which won't work! You need to change the jre version by choosing "Run As... > Ant build". Before clicking run, go to the JRE tab, choose "Separate JRE:" and change "Blackberry JRE " to a standard java JRE. Press the run button and everything should work correctly.
I hit this problem also. Although I never used the same solution, you pointed me in the same direction.
I was using a ant file as a builder in my project, and I disabled the Allocate Console build option. This is when I hit the 'Waiting for virtual machine to exit'.
So I simply enabled the Launch in background option and it worked.

eclipse debugger: attaching source-code of maven dependencies?

I'd like to use the source code of maven-managed dependencies when debugging our webapp in myEclipse 8.
I have managed to attach the sources to the libraries in the "Maven Managed Dependencies" classpath container, i.e. when I open a class file from a dependency (e.g. using Ctrl-Shift-T), I see the source code.
However, when I define a server connector for my tomcat, deploy the wepapp to it, and launch it in debug mode and execution halts on a breakpoint in that same class, the editor pane only displays the text "source not found", and a button to edit the "source lookup path". I have attempted to manually add the "Maven Managed Dependencies" classpath container, only to be told "Use maven project settings to configure depedency resolution". However, I see no useful setting in that property pane ...
How can I attach those sources? I am aware that this works with the m2e plugin and wtp, but I'd rather avoid convincing the rest of my team to switch plugins ...
Looks like issue MNGECLIPSE-983
I have confirmed that if I manually pick the External Archive option and find the relevant -sources jar (navigating that big .m2/repository tree to find it) and then add the jar as a sources it does work, and surprisingly it does remember the next time which isn't too bad.
That's at least doable I think for me because we don't often need to step debug through external dependencies, but when we do, it's often frequent, so adding it once while a bit of a pain, can be done on a case by case basis.
I have since discovered that this problem only occurs if the server is launched using a launch configuration.
The problem does not occur if the server is started by:
click the server icon in the toolbar -> context menu appears
mouse over the intended server -> submenu appears
click on "Start"
While this precludes sharing the server configuration by checking the launch configuration into version control, it at least allows seamless debugging.
Please do the following steps in Eclipse IDE(Tested with Version: 3.5.2),
In Package Explorer, Right Click on the Project which integrated with Maven container.
Select Maven 2 and then select "Fetch Source JARs".
The above action wil fetch sources of all the 3rd party jars present in the Maven Classpath.
Regards,
Rajesh.
Just put the .m2/repository/ folder itself with the search subfolders option.