eclipsec.exe options/ command line usage? - eclipse

Is there an exhaustive list of documented commands that I can use with eclipsec.exe?
Build Eclipse Java Project from Command Line
I see that we can build projects outside GUI. Is the command line powerful enough to control any other features inside eclipse GUI?
For example : Is it possible to launch a saved "Java Application" inside eclipse workspace from the command line directly?
Basically, I want to explore all options that I have on eclipsec.exe. I tried eclipsec.exe --help and eclipsec.exe -help to see if I can get some help but none of them work.

The Eclipse runtime options
- http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html
using p2 director to install/uninstall plugins
- https://wiki.eclipse.org/Equinox/p2/Director_application
- http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fp2_director.html
There is also linked Question Build Eclipse Java Project from Command Line

Related

Run "mvn clean install" in Eclipse

Title says it all.
I want to run the console command mvn clean install on my project in question directly in Eclipse, not from the command line.
It would just be more convenient for me to do this, as I already have the project open in Eclipse. It would save me time if I would not have to navigate to the folder in Windows Explorer.
Not a big deal if I can't do this... but can I? And if so, how?
It would be great if I could just right click my project, then click "mvn clean install" from the context menu.
I use eclipse STS, so the maven plugin comes pre-installed. However, if you aren't using STS (Springsource Tool Suite), you can still install the m2Eclipse plugin. Here is the link:
http://www.eclipse.org/m2e/
Once you have this installed, you should be able to run all the maven commands. To do so, from the package explorer, you would right click on either the maven project or the pom.xml in the maven project, highlight Run As, then click Maven Install.
Hope this helped.
Run a custom maven command in Eclipse as follows:
Right-click the maven project or pom.xml
Expand Run As
Select Maven Build...
Set Goals to the command, such as: clean install -X
Note: Eclipse prefixes the command with mvn automatically.
You can create external command Run -> External Tools -> External Tools Configuration...
It will be available under Run -> External Tools and can be run using shortcuts.
Right click on pom.xml, Run As, you should see the list of m2 options if you have Maven installed, you can select Maven Clean from there
If you want to open command prompt inside your eclipse, this can be a useful approach to link cmd with eclipse.
You can follow this link to get the steps in detail with screenshots.
How to use cmd prompt inside Eclipse ?
I'm quoting the steps here:
Step 1: Setup a new External Configuration Tool
In the Eclipse tool go to Run -> External Tools -> External Tools Configurations option.
Step 2: Click New Launch Configuration option in Create, manage and run configuration screen
Step 3: New Configuration screen for configuring the command prompt
Step 4: Provide configuration details of the Command Prompt in the Main tab
Name: Give any name to your configuration (Here it is Command_Prompt)
Location: Location of the CMD.exe in your Windows
Working Directory: Any directory where you want to point the Command prompt
Step 5: Tick the check box Allocate console
This will ensure the eclipse console is being used as the command prompt for any input or output.
Step 6: Click Run and you are there!! You will land up in the C: directory as a working directory
Just found a convenient workaround:
Package Explorer > Context Menu (for specific project) > StartExplorer > Start Shell Here
This opens the cmd line for my project.
Unless someone can provide me a better answer, I will accept my own for now.

Groovydocs on Eclipse

My enviroment:
OSX 10.7.4
Eclipse SDK
Version: 4.2.0
Build id: I20120608-1400
Does anyone know how to generate groovydocs via eclipse? I cant find any plugins to help me generate them. I have Groovy-Eclipse (Required) & Groovy Eclipse SDK (optional) installed.
If you have any solutions, please explain.
You will need to run them from the command line. If you want some amount of Eclipse integration, you can run them as an external tool. You can create an external tool here:
In the dialog that pops up, specify the path to groovydoc. In the argument section, place this (as well as any other options you want):
${folder_prompt:running groovydoc?:/Default/file/path}
This will open a folder prompt with the default file path specified. The choice of folder will be used as the argument to the groovydoc invocation.

How to make eclipse launch a program in the eclipse workbench from the command line?

How do I make eclipse launch a program in the eclipse workbench from the command line?
Specifically, I would like to run a command from the shell that causes my eclipse instance (which is already open) to run a particular program. If there is no program to do this from the shell, is there some RPC API that eclipse provides to make such a program?
I do not want to make a plugin. It must be a separate process that controls eclipse.
Eclipse Remote Control seems that it might do the trick https://github.com/marook/eclipse-remote-control from the Read me file.
Introduction
Eclipse plug-in project which adds remote control features to eclipse.
Commands can be sent via the eclipse remote control client to a
running eclipse instance.
I have not tried it myslef but I ran into it trying to figure out how to write an ant task that triggers .launch file
First create a batch file and save it in a location.
For example if I want to invoke notepad , I will write in the batch as follows
start notepad
In eclipse, you can configure external tools.
Goto Run -> External Tools -> External Tools Configurations.
You will be presented with a Dialog box.
Now Click on the New Configuration Icon.
In the right pane of Window you can assign a configuration Name.
In the Location Text Box, Click on the "Browse File System" Button, and select the batch file you have created earlier.
In the Common Tab, uncheck "Launch In Background".
You can set this configuration in Favourites menu, by clicking the checkbox "External Tools" under Common Tab.
Click on Apply.
Now you can Run your required application. This is for Windows only. I don't have any idea of this for Linux Machines.
Take a look at Product Configuration
1º Create a new Product Configuration (Ctrl+N), and select "Use a launch configuration" (or another option, if it's more convenient) on the first page of the wizard.
2º In the Exporting section you should be able to export your product using the "Eclipse Product export wizard".
3º To run the product, follow this instructions
Hope it helps.
Not a 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
That Main launcher takes an -application flag where you can pass what I think are plugins (not sure). I've typically used this to run Ant within 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 have no idea how to manipulate a running Eclipse instance, and I don't know if you can achieve your goals through an Ant script, but I thought these might be fruitful avenues.
Addition to ams' answer, marook's plugin just support very few commands.
open_file and execute_command with RUN/DEBUG/PROFILE
And marook also have a blog post about how to implement more command http://pielmeier.blogspot.com/2010/07/implementing-new-eclipse-remote-control.html
But as we all know, Eclipse plugin development is quite heavy weight.
So, I suggest just use execute_command with RUN by marook's plugin. The further function to Eclipse IDE, can be done by Eclipse EASE script engine. Write a light weight script and then RUN by marook's plugin, to avoid Eclipse plugin development.
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
Here you have a series of examples: http://www.rgagnon.com/javadetails/java-0014.html
Basically, you use:
Runtime.getRuntime().exec(command);

Is it possible to add external command line tools to Netbeans?

Is it possible to use external command line tools in Netbeans?
Thank you.
After searching and searching and searching, this feature is just missing in netbeans although it would absolutely straightforward to implement and has been ask by user for 2 more than years...
Regards,
Stéphane
There is a Terminal window in NetBeans 7:
Open the menu, Window -> Output -> Terminal
What about using an Ant target? Ant files are quite comfortable to run from Netbeans.
<exec executable="${executable-full-path}" ...
The best option I've found is to use jmarsault's plugin that he calls NetBeans Command Shortcuts. This give you an icon in the command line where you can add command and terminal scripts to run. The display shows in the output window.
Installation files are available here and he has kept it up to date with the newest versions of NetBeans.
NetBeans Command Shortcut plugin
Installation:
Download the .nbm file for your version of NetBeans
Open Tools / Plugins / Downloaded / Add Plugins...
Select the .nbm file and allow the installation of the plugin.
In since at least version 9.0, there are two decent options:
Just create a script file. (I think you need the C++ plugin for this. Otherwise you have to create it outside NetBeans or as a text file.) In my case I created a JLinkGDBServer.sh that just executes JLinkGDBServer as a prerequisite to start an embedded debug session. This automatically sends the executable's output to a NetBeans terminal.
Add a tool to Tools/Options/Miscellaneous/SendTo. SendTo is a pop-up menu item for certain project entities, for example files but not the project. In my case, I could add a SendTo running the executable and use it by right-clicking on for example the .elf file (although for the GDB server I don't need any file name as an argument).

Build several CDT C++ projects from commandline

What is the best solution to build several CDT C++ projects from the command line? The projects have references and so it is not possible to just build single projects.
This feature has been added in CDT 6 (Final build due June 15th 2009). You can download the final release candidate from builds page: download.eclipse.org/tools/cdt/builds/6.0.0/.
Using a release of Eclipse 3.5 + CDT 6, you can import, build and clean-build projects and the workspace using the following options sent to Eclipse at the command line:
eclipse -nosplash
-application org.eclipse.cdt.managedbuilder.core.headlessbuild
-import {[uri:/]/path/to/project}
-build {project_name | all}
-cleanBuild {projec_name | all}
On Windows, use eclipsec.exe instead of eclipse.exe to have build output written to stdout/stderr and so that the call blocks until completion.
The '-application' switch instructs Eclipse to run the CDT headless builder rather than starting the workbench. The other switches can be used individually or together. This means you can checkout a project using a shell script of your own, '-import' it into a workspace, and '-build' it using the Managedbuilder's headless builder.
Use the '-data' switch to specify the workspace to use, which can be an empty temporary directory, see the runtime documentation for other switches supported by the platform runtime:
help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html
See bug 186847 comment 24 and onwards for more detail on the committed functionality.
Pre CDT 6 you could use the JDT's AptBuilder (included with classic Eclipse, for example).
This lets you build an already configured workspace. So you: checkout your source, configure a workspace which points to the checked-out projects. Your automated build scripts can then update the checkouts and run the AptBuilder without needing to start the GUI.
If you created a Make project under CDT you can just use your favorite shell and execute make in all the projects dirs.
Headless build with the manage builder is currently not supported, see bug 186847 - CDT internal builder does not support automated command line builds.
If you use the unmanaged (make) builder, then you already have Makefiles that you can use from the command line.
We do this in our existing build.
Put a makefile in all your external references and your toplevel project.
In your "all" rule, have it run:
make -C ./externalref1
make -C ./externalref2
etc
we actually define the external dependencies in a variable:
EXT_DEP = externalref1 externalref2
then use the subst (substitute) command to kick off all the sub-makes using the correct call.