How to turn off debugging on a project in eclipse? - eclipse

My situation demands I have two copies of the same project. One is for development, the other is for debugging, testing and single stepping to understand the existing workflow.
As a consequence I have two copies of the same project. I would like both copies to behave exactly the same way except that the first project should not take part in debugging. All the JDWP [Java Debug Wire Protocol] attempts to connect and debug the remote Java process should be with respect to the untouched dedicated copy of the project that was checked out recently.
Is there a way to accomplish this?

You can create multiple debug/run configuration for the same or different projects in Eclipse.
Assume that you have a single Java project and you want to
Test your application with some VM arguments and
Without any VM arguments.
Then Go to Debug->Debug Configuration and select Java application. Create debug(launch) configuration for your project and select main class of your Java project.
For 1 go to Arguments tab in the VM text area add the arguments
For 2. Leave this blank
Thus you can debug single Java project with multiple debug configuration.
In your case you MUST create debug configuration ONLY for that project you want to debug.

Related

eclipse how to set run configuration default for a specific project

have several java servlet projects. Each one uses a different configuration file. The servlet use and environment variable to find the config file. I have several different run time configurations. One for each project.
Is there a way to set the default run time configuration for each project. I loose a lot of time because I try to debug and accidentally select the wrong profile
Kind regards
Andy

Default configuration for Eclipse plugin test

I'm working on a project developing an Eclipse-based application. Running a JUnit plug-in test requires the run configuration for it to have a bunch of parameters set. This means that if I want to run a single test class or method, as far as I can tell I have to create a new configuration or edit one that I reuse. More annoyingly I can't use the convenience of Alt+Shift+X, P.
Is there a way to tell Eclipse that a bunch of parameters are the defaults for an implicitly created run configuration of a given type to use it when it's automagically creating one?
If you are using a custom target platform (which you should use anyway), you can specify Program arguments and VM arguments on the Environment tab of the target platform editor.
They will be used as default values for PDE launch configurations.

GWT SuperDevMode overwrites production code when using launcherdir

I'm trying to use the new SuperDevMode with -launcherdir parameter and currently I point launcherdir to the same folder as where production code is deployed.
The effect is that the .nocache.js file gets overridden by SuperDevMode's nocache.js file and it's impossible to run the app in production-mode(hosted mode) without doing another full recompile.
Is there any way to switch back and forth between SuperDevMode and production mode?
Thank you!
This is indeed how SDM works; the solution is to use distinct output folders for production and dev modes, but this all depends on your build tools, etc.
For instance you could assemble your web app in a distinct folder so you can run it with DevMode.
Or you can use a separate server (or even possibly a reverse proxy) that you configure to load the CodeServer-generated nocache.js in priority over the production one from your assembled webapp. This is what I do in Maven with the Tomcat or Jetty plugins for instance.

Java EE EAR debugging with source tree

I've recently been assigned to work on a Java project. I don't have a lot of experience with this kind of development, so I'm kind of struggling.
The typical development process for this project is:
Make changes in source code
Run ant build script to create EAR
Deploy EAR to development server (Weblogic 12.1.2)
Run application and see if the changes you've made fix the issue you're working on.
So, I am taking it as my personal goal to make it possible to do local development, so debugging will actually work and such.
After spending time googling and playing around, I'm able to get at least part of the way, but am having trouble towards the end of the process.
I've tried some different methods to try to get things working.
First, I checked out the source code via Eclipse, so it shows up as a Project and is correctly linked to subversion. I can bring the build.xml file into the Ant view and build the target I'm interested in. This gives me a EAR file (and a WAR file). But when I try to debug the project, via the right-click on the project and selecting Debug As... I get three options: Java Applet, Java Application, JUnit Test.
If I choose Java Applet, I then get a Select Java Applet popup. After choosing what I think is the right applet I get Errors exist in required project(s), Proceed with launch? If I proceed, I get an Applet Viewer and a bajillion errors and nothing else. If I don't proceed, then the Error log fills up with a bajillion other errors.
If I choose Java Application I get a list of a bunch of different entries, none of which is what I'm trying to debug.
So, after trying all that, I decided to see if I could just import the generated EAR file and debug that way. So, I went through the Import wizard, found the EAR file that I build via Ant. After selecting that and proceeding through the dialog, I get two projects in my Project Explorer: the application (we'll call it AppX) and the AppX_WEB project.
Now, if I select the AppX project and choose Debug As, I get Debug On Server, which is promising. The Console tells me that the server is listening on 127.0.0.1:7001, and the built-in browser actually starts bringing up the page. So I'm feeling pretty good about all that.
The problem is, though, I don't know how to attach that EAR file to the source tree that I've got already so I can actually step through the code.
And going deeper, how do I set it up so that I can develop in my source tree and have them automatically propagated into the EAR file and redeployed?
Or, even better, can I get this working without having to build the EAR file and deploy it? Meaning, can I just run straight from the source tree?
Anyway, any help you can give will be much appreciated.
Thanks!
You can start your server in debug mode then attach eclipse to the running instance and debug it.
For this enable debug port in jvm configurations on your server and launch remote application debugging in eclipse.

How to add build steps to Eclipse "run configuration"?

Is there a way to add build steps to a "run configuration" in Eclipse?
My project uses an applet that should be built before starting the web application. So I'd like to configure Eclipse to do this single step before actually running the application.
I know I can do it with Ant/Maven, but I wonder if there's a way to do it in Eclipse.
Thanks
For a classic launching (Java or Java Applet) configuration, no. Not directly.
For an External Tols launcher, not directly either.
The idea would be:
to not build your applet every time you modify your main project
make sure it is built when you want to launch your webapp.
For that, you could define two projects:
one for the compilation of your main project.
the second (depending on the first) for the compilation of your applet.
Your launching configuration would then run with the second project (which includes the first)
If the option "Build automatically" is selected, the second project shouldn't run without being compiled first.