How to use Launch [message #84837] |
Tue, 12 August 2003 14:29 |
Eclipse User |
|
|
|
Originally posted by: a_jordanov.prosyst.bg
I tried to launch process and to registrate it in the launch manager but i
am receiving
Unhandled exception caught in event loop.
Reason:
org/eclipse/debug/core/Launch
Could you tell me where i am wrong?! Here is the code:
public static void start() {
String cmdLine = "java HelloWorld";
File workDir = new
File(" e:\\eclipse2.1.1\\eclipse-sdk-2.1.1-win32\\eclipse\\workspac e\\hellowo
rld\\output");
Process p = Runtime.getRuntime().exec(cmdLine, null, workDir);
ILaunch launch = new Launch(new Object, ILaunchManager.RUN_MODE, null);
try {
getLaunchManager().addLaunch(launch);
//IProcess process= DebugPlugin.getDefault().newProcess(launch, p,
cmdLine);
IProcess process = DebugPlugin.newProcess(launch, p, cmdLine);
process.setAttribute(IProcess.ATTR_CMDLINE, cmdLine);
launch.addProcess(process);
return;
} catch (Exception e) {
e.printStackTrace();
}
getLaunchManager().removeLaunch(launch);
p.destroy();
}
Regards, Alex
|
|
|
Re: How to use Launch [message #89321 is a reply to message #84837] |
Tue, 26 August 2003 18:37 |
Darin Wright Messages: 454 Registered: July 2009 |
Senior Member |
|
|
The first parameter to Launch(...) should be an ILaunchConfiguration, not an
Object.
Darin
"Eclipse Newsgroup" <a_jordanov@prosyst.bg> wrote in message
news:bhatjl$81j$1@eclipse.org...
> I tried to launch process and to registrate it in the launch manager but i
> am receiving
> Unhandled exception caught in event loop.
> Reason:
> org/eclipse/debug/core/Launch
>
> Could you tell me where i am wrong?! Here is the code:
>
> public static void start() {
> String cmdLine = "java HelloWorld";
> File workDir = new
>
File(" e:\\eclipse2.1.1\\eclipse-sdk-2.1.1-win32\\eclipse\\workspac e\\hellowo
> rld\\output");
> Process p = Runtime.getRuntime().exec(cmdLine, null, workDir);
> ILaunch launch = new Launch(new Object, ILaunchManager.RUN_MODE, null);
> try {
> getLaunchManager().addLaunch(launch);
> //IProcess process= DebugPlugin.getDefault().newProcess(launch, p,
> cmdLine);
> IProcess process = DebugPlugin.newProcess(launch, p, cmdLine);
> process.setAttribute(IProcess.ATTR_CMDLINE, cmdLine);
> launch.addProcess(process);
> return;
> } catch (Exception e) {
> e.printStackTrace();
> }
> getLaunchManager().removeLaunch(launch);
> p.destroy();
> }
>
> Regards, Alex
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03358 seconds