Eclipse RCP: How to set launch parameters? - eclipse

You need to set the path to the directory "splash_v1" in plugin "com.project.console". Example without directory "splash_v1":
osgi.splashPath=platform:/base/plugins/com.project.console

If you are asking how to define launch parameters when starting up your RCP application you have two options.
Define them in the Run Configuration (configurable via Project > Run Configurations)
Define them at startup by passing them in with the executable from the console (e.g., ./myrcp -application myrcp).
For an overview of runtime options, cf. The Eclipse runtime options.

Related

Eclipse + CDT: How to batch build several build configurations

I have an eclipse CDT project that builds static and shared libraries. I have created several build configurations for them.
I want to know if there is any way to do a batch build i.e. build all configurations at once with single operation. I tried "Build All" (ctrl+B) but it seems to be building only the current configuration (just that it applies "all" as the target for the current configuration).
One of the earlier posts suggest making use of CMake(http://stackoverflow.com/questions/5204180/how-to-build-several-configurations-at-once-with-cmake) .
Is this the way, or is there any other alternative without getting into CMake.
regards,
Ravi
If you have CDT installed, then there is also a launch configuration type called Launch group. You can create one of that to list all your other already configured launch configurations and to execute one after the other. Make sure to set the post build action in the list dialog to "wait until terminate".
put all your projects into a tree (symlinks), e.g. my/Projects and run a headless build (ref http://gnuarmeclipse.livius.net/blog/headless-builds/)
eclipse -application org.eclipse.cdt.managedbuilder.core.headlessbuild -importAll my/Projects -cleanBuild all -nosplash -data ./eclipse_ws_dir --launcher.suppressErrors -vmargs -Xmx7g

how to export or copy java applet parameters on eclipse

I set a bunch of applet parameters on run/debug configurations on eclipse.
I would like to share these parameters with my co-workers, but I cannot find an easy way to copy these parameters. I looked through the plugin and project files to figure out where these parameters are stored, but I couldn't find them. Does anyone happen to know where these configurations are stored?
thanks in advance...
Launch configurations in Eclipse can be saved in the workspace in one of the projects and committed under source control. When the project is imported in Eclipse, the launch configuration will be found and automatically added in Eclipse.
To store the launch configuration in the workspace:
Run > Run Configurations... > Select the launch configuration > Common tab > Shared file
In the text field, you specify the location, where the configuration to be stored.

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);

Adding eclipse jvm arguments to version control

In our eclipse project we have some jvm arguments that are required for the project to work. The project is connected to clearcase for version control.
How can we add the jvm arguments to version control so new developers will have them set up when they join the project (or have the rest of the team updated when someone makes a change)?
Thanks,
Alex
Where are theses JVM arguments needed? At the launch of Eclipse? For the compilation of your project?
If you need JVM arguments at the launch of Eclipse, you have to edit the "eclipse.ini file", at the root of your Eclipse installation folder.
If you need JVM arguments at compile time, you can customize them in Eclipse preferences.
You can add them to a launcher that you will:
export within your current version-control workspace
version
See where are the external tools launch configurations in Eclipse.
See also blog post "Tip: Creating and Sharing Launch Configurations"
Select the 'Shared file' option. Select the project to which this launch configuration belongs. I suggest the launch configurations to be saved at the root of the project directory.
have you tried adding it to your build.xml?
I would create lunch configuration that can be imported later on. First create a run/debug configuration, for successful run on your local pc. If it is team project this run configuration will be fine on others machines. Then export it: file->export-> run/debug->launch configuration and select correct one that you have created. Then you will get that exported to the file that can be kept under version control. To import it do file-> import -> run/debug -> launch configuration and select the file.

setting ANT_OPTS in eclipse

Does anyone know how to set ANT_OPTS in eclipse's ant runner and have it picked up?
I've tried setting it via the Environment tab in the External Tools setup, but that doesn't appear to be picked up.
I'm trying to set the following:
-Djava.util.logging.config.file=logging.properties
so that I can turn on debug logging in some Oracle deployment ant tasks. Their instructions specifically say to set ANT_OPTS, although any other way to get ant to pick up the setting would be fine as wel.
You are correct:
The kind of JRE property is to be set in the Argument tab (VM part) of a launcher:
(source: sim-bio.org)
The Environment tab defines the environment variable values to use when running or debugging a Java application. By default, the environment is inherited from the Eclipse runtime. You may override or append to the inherited environment.
(source: eclipse.org)