How to get eclipse to run a program in the eclipse workstation from the command line?

How to get eclipse to run a program from the eclipse toolkit from the command line?

In particular, I would like to run a command from a shell that forces my eclipse instance (which is already open) to run a specific program. If there is no program in the shell for this, is there some kind of RPC API that provides an eclipse for creating such a program?

I do not want to create a plugin. This should be a separate process controlling the eclipse.

+8
eclipse
source share
6 answers

Eclipse Remote Control seems like it can do the https://github.com/marook/eclipse-remote-control trick from the Read me file.

Introduction

Eclipse plug-in project that adds remote control features for eclipse. Commands can be sent through the eclipse remote client to launch an eclipse instance.

I have not tried this myslef, but I came across it trying to figure out how to write an ant task that runs a .launch file

+5
source share

See Product Configuration

1ΒΊ Create a new product configuration (Ctrl + N) and select "Use Launch Configuration" (or another option, if it is more convenient) on the first page of the wizard.
2ΒΊ In the Export section, you can export your product using the Eclipse Product Export Wizard.
3ΒΊ Follow these instructions to start the product.

Hope this helps.

+1
source share


First create a batch file and save it in a specific place.
For example, if I want to call notepad, I will write in the package as follows
launch notepad
In eclipse you can customize external tools.
Goto Run β†’ External Tools β†’ External Tool Configurations.
A dialog box will appear.
Now click the "New Setting" icon.
In the right pane of the window, you can assign a configuration name.
In the Location text box, click the Browse File System button and select the batch file that you created earlier.

In the general tab, clear the "Run in the background" checkbox.
You can set this configuration in the Favorites menu by selecting the External Tools check box in the General Tab section.
Click "Apply."

Now you can run your desired application.
This is for Windows only.
I do not know about this for Linux Machines .

+1
source share

Not the complete answer, but here are some things I've come across with Eclipse:

In general, you can open Eclipse from the command line with something like:

java -Dosgi.requiredJavaVersion=1.5 -Dhelp.lucene.tokenizer=standard -Xms40m -Xmx512m -XX:MaxPermSize=256m -cp plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar org.eclipse.core.launcher.Main

This main panel launches the -application flag, where you can pass what I think are plugins (not sure). I usually used this to run Ant in Eclipse:

java -Dosgi.requiredJavaVersion=1.5 -Dhelp.lucene.tokenizer=standard -Xms40m -Xmx512m -XX:MaxPermSize=256m -cp plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar org.eclipse.core.launcher.Main -application org.eclipse.ant.core.antRunner -buildfile build.xml

I don’t know how to manipulate a running instance of Eclipse, and I don’t know if you can achieve your goals with the Ant script, but I thought it could be fruitful.

0
source share

Addition to the ams answer, the marook plugin just supports very few commands.

open_file and execute_command with RUN/DEBUG/PROFILE

And marook also has a blog post on how to implement more of the http://pielmeier.blogspot.com/2010/07/implementing-new-eclipse-remote-control.html command

But, as we all know, the development of the Eclipse plugin is quite difficult.

So, I suggest using execute_command with the marook RUN plugin. A further function of the Eclipse IDE can be performed using the Eclipse EASE script engine . Write a light weight script and then a marook RUN plugin to avoid developing an Eclipse plugin.

More information about EASE can be found at:

https://opensource.com/life/16/2/how-use-python-hack-your-ide

There is also javascript script support:

https://git.eclipse.org/c/ease/org.eclipse.ease.scripts.git/tree/JavaScript%20Beginner%20Tutorial/02%20File%20IO/05%20Create%20sample%20project%20(using% 20modules) .js

0
source share

Here you have a number of examples: http://www.rgagnon.com/javadetails/java-0014.html

You mainly use:

 Runtime.getRuntime().exec(command); 
-one
source share

All Articles