Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to use Launch
How to use Launch [message #84837] Tue, 12 August 2003 14:29 Go to next message
Eclipse UserFriend
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 Go to previous message
Darin Wright is currently offline Darin WrightFriend
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
>
>
Previous Topic:Linuk GTK platform colors
Next Topic:newbie question: Javadoc for standard JDK API
Goto Forum:
  


Current Time: Fri Jul 05 02:28:42 GMT 2024

Powered by FUDForum. Page generated in 0.03231 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top