Using intellij to debug eclipse plugins - eclipse

I am currently working on eclipse plug-in that involves many modules, and I would like to debug and run this eclipse plug-in from IntelliJ.I open this project in IntelliJ to edit code but when I have to run/debug this project I have to open eclipse IDE and start it from there. How can I use IntelliJ to do this?

I haven't actually tried this ... but you could try launching the RCP application stand alone but with the remote debug parameters specified for in your application's .ini file.
Then just point IntelliJ to the appropriate source and attach it's debugger to the running app.

Why do you want to do that? Eclipse has multiple tools for the plugin development that you will miss in IntelliJ. Also you need to build your plugin as product headless and then attach a debugger to it.
In my opinion it doesn't worth the effort. I would install Eclipse and devolop with eclipse.

Related

Eclipse Add Perspective to Runtime

I'm creating a content analysis plugin for Eclipse and I'm testing it in Eclipse by running Eclipse Application.
This worked well (since my plugin only had to work with a plain text editor), but now my company has stepped over to using oXygen as XML plugin in Eclipse for our technical writers. To test whether my plugin also works with oXygen in use, I need to have the oXygen XML Author plugin working in the Runtime.
I have oXygen working in my main Eclipse, but that is not what I want: I need it in my Runtime Environment.
So my question is: how can I add this oXygen plugin to the Eclipse Runtime Environment?
Go to your debug/run configuration -> Select the configuration in question.
Go to plug ins tab. Check if the Oxygen plugin is in the list. If not then add it explicitly and launch the runtime again.
Hope it helps.
cheers,
Saurav

Eclipse application - adding a python console plugin

I'm developing an eclipse application in Linux and I'm fairly new to eclipse RCP.
My application is built from already existing plugins, such as eclipse's project explorer, etc.
I'd like to add the pydev python console as a plugin to my application.
I know that adding plugins to an eclipse application is done through the extensions tab on MANIFEST.MF but I can't find any examples on google on adding the pydev console.
Can someone help?
Thanks,
Dolev.

Debugging an eclipse within another eclipse - Eclipse Trader

According to this link
It seems easy to setup the environment. Into the last paragraph:
Setup the Run Configuration
There should be a misterious EclipseTrader run configuration appearing from nowhere !!
Obviously there is no such thing !!
The question is, how can I debug an eclipse within another elipse ?? Is it possibile ?
If you don't have the Eclipse application entry in the available debug configurations then you should probably be running an Eclipse which does not have the plug-in development environment (PDE) installed.
You can either download the Eclipse classic package which already contains PDE from the download page or install the PDE plug-ins in your current Eclipse platfom from the Eclipse update sites.

Debugging Eclipse plug-ins

This is my first attempt at creating an Eclipse plug-in. I've created one, along with a feature and update site. I set the target platform as my local Eclipse installation. When I run/debug the plugin from within the development environment everything works fine.
Now, my colleague installed the plug-in from the update site that I hosted. When he starts using any of the functionality exposed by my plugin he gets runtime exceptions.
He sees null pointer exceptions which didn't occur when I ran my plug-in project from my development environment.
I have a wizard that's part of my plug-in. When he close it he gets a "Unhandled event loop exception", and the wizard doesn't close. I didn't have this issue when I was running/debugging my plugin in my development environment.
Now I'm confused as to why the same plug-in is behaving differently in the production environment, as against the dev environment and when I was debugging it from my IDE. The target platform in both cases is the same Eclipse version. What could be the reasons?
And how do I debug the plug-in in a production environment? Is there a remote debugging capability for debugging the plug-ins on the production environment?
Any suggestions would be really useful!
To remote debug your plug-in, first add debug arguments to your target Eclipse .ini file
-vmargs
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044
before launching it.
Then open another Eclipse instance with a workspace containing your plug-in project.
Open Run > Debug Configurations..., select Remote Java Application and create a new configuration.
As Project, browse and select your plug-in project.
Also fill in your connection properties (host of target Eclipse and port 1044).
Launching the newly created debug configuration allows you to debug your plug-in the same way you debug locally.
Now I'm confused as to why the same plug-in is behaving differently in
the production environment, as against the dev environment and when I
was debugging it from my IDE. The target platform in both cases is the
same eclipse version. What could be the reasons?
This is a classic: Eclipse plugins and RCP applications do indeed behave differently between PDT (the Eclipse IDE) and the exported product.
In your case, a NullPointerException thrown from the exported version but not from Eclipse is 9 times out of 10 an image or other resource files (properties, etc.) that is loaded by your code but is not listed in the build.properties of your plugin.
Anyway, you'll need to check the logs to retrieve the stacktrace and hunt down its cause. Such logs could be found in your friend's workspace under le .metadata/.log file
From your development workspace as it stands now, use the "Debug As -> Eclipse Application" menu item to startup a test workspace. When it starts up, you'll have two workspaces running: the original development workspace and the new test workspace. You can set breakpoints in your plugin code in the development workspace and run your plugin in the test workspace.
When your plugin execution in the test workspace gets to one of your breakpoints, execution will pause and you can use the Debug view in your development workspace to look at variables, set more breakpoints or anything else you want to do to debuf your plugin.
See the Apache Wiki for Developing with Eclipse.
Under Windows 10 with Tomcat running as a windows service I started:
tomcat8.5\bin\Tomcat8w.exe
& added in the Java tab as the first entry in Java Options to enable remote debugging:
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n

How do I debug Lift applications in Eclipse?

I come from a background in C++, Python, and Django and I'm trying to expand my horizons and learn Scala and Lift. However, I'm having a really hard time figuring out how to debug Lift applications using eclipse.
I can create projects using some of the lift sbt templates and run them no problem. However, I haven't been able to start the application from within Eclipse because it can't find Jetty, and as a result, I'm not able to use the debugger to step through the Lift code. Weeks of googling haven't helped much.
Could someone share their methods or suggestions? I'm also new to the jvm, so feel free to share best practices or point out important differences that I may be missing.
Ok, I've gotten this figured out.
So I'm not actually launching the application from the Eclipse debugger. I'm starting the application through sbt, and then connecting the Eclipse remote debugger to the sbt vm that's running the webapp.
Here's what I did:
Assuming you have sbt-launch.jar in /bin:
Create the file /bin/sbt_debug with permission to execute and containing this line:
java -Xmx512M -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar /bin/sbt-launch.jar "$#"
What this script is doing is starting sbt and instructing the jvm to allow debugging on port 5005
Go to your lift project directory in your terminal and enter sbt_debug. Once you're in the sbt console enter container:start / container:update or ~jetty:start / ~jetty:update depending on which version of sbt you're using.
Next go to Eclipse, click the debug icon and select "Debug Configurations..."
On the left column, click "Remote Java Application" and create a new debug configuration. Set the Port to 5005.
Hit the Debug button and the Eclipse debugger should now be debugging the sbt process you started earlier
Note: This is the first method that has worked for me. If you have one that is better, please share
I've found the most useful tools to be the SBT Eclipse Plugin and the RunJettyRun plugin for Eclipse. The former will allow you to generate Eclipse config files based on your SBT setup and the latter will launch Jetty from Eclipse with the debugger attached. An added bonus is that generating your Eclipse config using "eclipse with-source=true" from the SBT prompt will download and attach src jars as well so you can step through Lift and any other 3rd party libraries you depend on as well as your own code.