Create Batch file to repeat IDE-like launch from external [message #643193] |
Sun, 05 December 2010 18:09  |
Eclipse User |
|
|
|
My use scenario is kind of unusual...
I have a RCP application in the Run configuration in the Eclipse IDE. And i want to be able to rerun the application from outside (Batch file), without the need of eclipse running or exporting the application. This is because I want short edit/compile/run cycles, but the run step shall be done outside. However....
If I only could find out all arguments Eclipse is passing to the started VM, then I could create a batch file for the current installation.
What I tried:
I used System properties to get the classpath, which has the path to the org.eclipse.equinox.launcher_1.1.0.v20100507.jar.
Then I throw an exception in the application to get an error log and used the line:
Command-line arguments: -product .........
Now I build a java call like:
C:\TestEnv>java -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m -jar C:\Eclipse36\eclipse\plugins\org.eclipse.equinox.launcher_1. 1.0.v20100507.jar -product TestEnv.product -data C:\Eclipse36\workspace/../runtime-TestEnv.product -dev file:C:/Eclipse36/workspace/.metadata/.plugins/org.eclipse.p de.core/TestEnv.product/dev.properties -os win32 -ws win32 -arch x86 -consoleLog
What happens is, I get another error output, "!MESSAGE Product TestEnv.product could not be found." and a window comes up with the menus from eclipse.
1. What am I doing wrong? How can I make the launcher find my product?
I am using the same working directory. The TestEnv.product file is there and the bin directory also (there is reference to it in workspace dev.properties)
2. How can I get the needed information automatically? (e.g. without forcing an error log to be written)
Frank
|
|
|
|
|
|
|
Re: Re: Re: Create Batch file to repeat IDE-like launch from external [message #643290 is a reply to message #643261] |
Mon, 06 December 2010 06:45   |
Eclipse User |
|
|
|
Hi Frank,
I see. There is a solution for that. If you go to your launch configuration,
there is a "Common" tab. In here you can save the launch configuration to a
local file in your project. The user can rightclick that and launch it.
--
Best Regards,
Wim Jongman
> The debug solution in fact is much easier :d
> But, unfortunately still manually.
>
> With Platform.getApplicationArgs() I can only get the args that are not
consumed by the RCP framework.
>
> I fact I want to get the complete command line that is generated from the
Run-Dialog, so that I write a batch file, that i can than call from outside.
>
> So a user can SVN-checkout the project, start eclipse (building), start the
app at least once (it creates the batch file from its own call) and from now
on, the external environment is able to start the RCP app with all parameter
set right.
|
|
|
|
|
|
Re: Create Batch file to repeat IDE-like launch from external [message #643469 is a reply to message #643427] |
Mon, 06 December 2010 19:08  |
Eclipse User |
|
|
|
Thanks, now it is perfect.
To summarize for anyone interested in this...
1. System property "java.home" to get the jre and java.exe
2. ManagementFactory.getRuntimeMXBean() to get the VM args
3. System property "classplath" to find the path to the launcher
4. Platform.getConfigurationLocation().getURL() for the -configuration arg
5. EnvironmentInfo getCommandLineArgs() for the remaining RCP args
6. Platform.getApplicationArgs() for the remaining appl args
Thanks for all the replies
|
|
|
Powered by
FUDForum. Page generated in 0.29483 seconds