How can I view stdout for an RCP built in Eclipse? - eclipse

I'm attempting to write a plugin for an RCP application.
I started with the Hello World plugin template in Eclipse. Ran it. Saw it worked in Eclipse. Exported it and dropped the jar into the plugin directory for the RCP application and started that application. It didn't add the new menu.
I changed the code to instead just have a popup on startup (using the org.eclipse.ui.startup extension point.)
I ran that. Saw it worked in Eclipse. Exported and dropped into the RCP application. It doesn't show the popup.
So... I think at this point I want to somehow view the stdout/stderr for the RCP application. I could add in a simple message that goes to stdout on startup in the plugin and see if that shows up. I could also check it for errors, to see if maybe it says there was somekind of error in loading my plugin or something.
The issue is, when I launch the application from PowerShell, it immediately returns the prompt. How do I end up viewing the stdout/stderr from the application?

Correct way to launch eclipse application from CMD is java -jar "%EQUINOXJAR%"
Reference
Eclipse Wiki Starting_Eclipse_Commandline_With_Equinox_Launcher

Related

Clicking run configurations not working for the java file I click on is my eclipse bugged or is this a simple fix?

Every time I right click on a java file to use the run configuration it won't open for that specific file I'm clicking on but the one I previously did. It will do the same for the button on the menu bar at top. I also noticed that it will only allow me to right click and use run configuration on the one I want only until after I run the program and get a run time error. I've tried to restart eclipse but it does the same thing still. So is this a bug on eclipses part or is it a preference option that can be changed?
Currently using Eclipse IDE for Java Developers - 2021-06
This all depends on what object you are right-clicking on, and its characteristics. If Eclipse doesn't see a "main" method, it won't allow running it as a Java Application.
In any case, you've provided very little information here. For instance, we have no idea what "it won't open" means.

Eclipse CDT doesn't run the program

I have written a small piece of code in C++(gui/wxWidgets) . It compiles/ links without any errors and produces an executable that when launched from command line opens the desired 'Hello World!' window, but when tried from within eclipse (menu, toolbar or ctrl-F11), it doesn't run. A quick error dialog appears/disappears before it can be read. After many runs I could make out that of the two msgs it displays, one reads something like "Looking for executables...". Apparently eclipse is unable to get to the executable in the Debug folder.
I tried a console application which runs without any issue from within eclipse as well.
My installation is indigo on Ubuntu 12.04.
Any ideas what could be the problem?
Problem resolved.
There was no Launch Configuration in Project Properties -> Run/Debug Settings.
Added one with defaults and it worked.

Where do an Eclipse's plugins log files go to?

I have an eclipse plugin which is failing. I developed/enhanced it based off of another plugin. When I deploy this plugin as an update site and install it into another instance of eclipse, it works initially (the view shows up). But as I try to interact and use the view, it's functionality is broke (it doesn't do anything when I click a given button). I don't see any error on the screen and nothing in the Eclipse Error Log view shows up.
I want to know where/if it has any error log files by default? If it had any custom loggers where would these sent to? I'm using Eclipse 3.7 (Indigo).
If I want to find out the cause of this exception must I implement my own custom log files?
Well, The error log file will be in your "eclipse workspace"\.metadata\.log
But that's just the file that shows up in the Eclipse Error Log view.
If the plugin you are using had some sort of extra logging (I doubt it) the logical place for it would be "eclipse workspace"\.metadata\.plugins\{plugin.name}" although that depends on the application..
If your application works when you debug it, but doesn't work when you deploy it, it's probably some sort of deployment issue.. Eclipse can be very very picky about picking up new versions of jars. Make sure you update your manifest version or delete your work space before doing an install. Another thing that can happen is you are missing plugins or plugin fragements that are needed or the minimum version specified isn't correct.
You don't have to implement logging. You can use eclipse to attach a debugger to your deployed application and then debug the application as you would normally. Although, if you plan on selling your application, logging is always a good idea :)
Go to eclipse installed directory and inside .metadata folder there will be a log file without name. That will be the plugin log

Importing Eclipse Plugin source in Eclipse

I have the source code for the VersionOne plugin. I am wanting to modify the code because I am getting a NullPointerException when I click a specific button on the plugin which crashes eclipse. I was wondering what steps I need to take in eclipse to import the source code, modify it, and get it to run. I have read over how to create a new plugin project, but I have never tried importing a plugin before. Plugin Source
Once you have imported the project and that seems to work fine, just run it like any other plugin.
I.e:
Set the breakpoints you want in the code
Click the "Run as..."
In the run dialog start up a new Eclipse instance
On the tab "plugins" make sure your imported plugin is selected
If you are using the plugin at the same time, make sure that the non-workspace is not selected
In the new Eclipse instance, set up a situation that will provoke the bug
You need the following things to do that:
From Eclipse download a distro with PDE (Plugin Development) included.
The source pages
Some configuration management tool like Git or Subversion.
You do then the following steps:
Unzip your sources locally somewhere and add them to the CM system.
Create an eclipse plugin project from that source location (depending on Git or SVN different steps).
Create a run configuration for Eclipse that includes that plugin. That is similar to creating a run configuration for Java, but your Java application is then eclipse (see the Help on Eclipse Application Launcher). You have to ensure that in the "Plug-ins Tab", your new plugin is included. After you have started it, you should see the new feature implemented in the new running eclipse. To debug it, you just have to press the debug button instead of the run button. You may then add breakpoints to the source code of your plugin to see how it is working.
You are then able to start a new eclipse application which includes the plugin and make your tests there. You are able to set breakpoints, debug the code and so on. If you find the error, you can change the code, test it, and as a result have a difference to the source you had initially. The best would be then to make a patch and send it back to the originator.
To deploy it then to others is a different story, and is well documented.

Eclipse plugin sample could not be run

On my Mac computer, I follow the tutorial on this page to get the Taipan example run, but still failed so many times.
Switch to the Plug-in Development perspective and open the models folder within the org.eclipse.gmf.examples.taipan project. Explore each of the models found hereand their element properties. You'll notice that there are full and RCP versions of the generated Taipan examples to explore.
When I try to run as "Eclipse application", it launches a new eclipse app but the dialog box Examples does not have the 'Taipan Diagram' as it says:
create an empty project and a new 'TaiPan Diagram' found in the Examples folder of the New dialog
What are the possible causes? Someone helps me to solve it out?
I'm assuming that your plugin is working fine and doesnt show compilation errors?
Then the most likely reason is that you havent chosen your plugin to be active in your launch dialog.
I answered a similar question with this:
My guess is that you have just created the plugin, but aren't running it in your current Eclipse instance. That can be verified by opening the view "Plugin registry". That will show a list of all plugins, see if the plugin you have created is in that list.
If you click on the run button in Eclipse you will open a run configuration dialog. In one of the tabs, you get to choose what plugins should be available. Make sure your plug-in is selected. This will start up a new Eclipse instance that will run your plugin.
To make your plugin be a part of your ordinary Eclipse installation, you will need to export it to a jar and copy that jar to the dropins catalog.