Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Starting Eclipse from Java
Starting Eclipse from Java [message #106868] Wed, 26 March 2008 17:45 Go to next message
Frank Traenkle is currently offline Frank TraenkleFriend
Messages: 4
Registered: July 2009
Junior Member
Hi,

I need to start Eclipse from another Java application. The JVM shall be
shared with the other application.

I need to frequently start and shut down Eclipse. The first two times this
works fine. But the third time, I get a UnsatisfiedLinkError in
org.eclipse.core.runtime.adaptor.EclipseStarter line 176 with the detailed
message:
no swt-win32-3349 or swt-win32 in swt.library.path, java.library.path or
the jar file

The Eclipse version is Version: 3.3.2 Build id: M20080221-1800 on Windows
XP and Sun jdk-1.5.0_15.

The only referenced jar of the example code below is
org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar

Thanks for help.

Frank


Here is the example code:

--
package gt.eclipsestarter;

public class Starter {

/**
* @param args
*/
public static void main(String[] args) {
try {
for (int i = 0; i < 3; ++i) {
System.err.println("Starting Eclipse number " + i);
org.eclipse.equinox.launcher.Main
main(new String[] { "-noExit" });
System.err.println("Eclipse number " + i + " started");
}
} catch (Throwable e) {
System.err.println(e.getMessage());
}
}
}

-- end of example code
Re: Starting Eclipse from Java [message #106886 is a reply to message #106868] Wed, 26 March 2008 17:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frank.traenkle.online.de

In the meantime I have digged further into this. Now I am using
org.eclipse.core.runtime.adaptor.EclipseStarter. But the behavior is still
the same. I get the very same exception on the third iteration.

Here is the new example code.

Thanks

Frank

--
package gt.eclipsestarter;

public class Starter {

/**
* @param args
*/
public static void main(String[] args) {
try {
for (int i = 0; i < 3; ++i) {
System.err.println("Starting Eclipse number " + i);
org.eclipse.core.runtime.adaptor.EclipseStarter
run(new String[] {"-noExit",
"-configuration",
"C:/tmp/test.helloworld/eclipse/configuration" },
null);
org.eclipse.core.runtime.adaptor.EclipseStarter.shutdown();
System.err.println("Eclipse number " + i + " started");
}
} catch (Throwable e) {
System.err.println(e.getMessage());
}
}
}
Re: Starting Eclipse from Java [message #107029 is a reply to message #106886] Fri, 28 March 2008 22:30 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
Hi Frank,

Can you please open a bug for this. Equinox tries to work around a VM
limitation that prevents the same library from being loaded multiple
times from the same file path. We basically copy the library to a
temporary path and attempt to load it from there. I suspect something
maybe going wrong with this code on multiple restarts. Bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=156873 was the original issue.

Tom.
Re: Starting Eclipse from Java [message #107087 is a reply to message #107029] Sun, 30 March 2008 17:18 Go to previous messageGo to next message
Frank Traenkle is currently offline Frank TraenkleFriend
Messages: 4
Registered: July 2009
Junior Member
Hi Tom,

I have created the bug report
https://bugs.eclipse.org/bugs/show_bug.cgi?id=224798

Do you know a workaround? I need a solution this week.

Thanks.

Frank


Tom Watson wrote:

> Hi Frank,

> Can you please open a bug for this. Equinox tries to work around a VM
> limitation that prevents the same library from being loaded multiple
> times from the same file path. We basically copy the library to a
> temporary path and attempt to load it from there. I suspect something
> maybe going wrong with this code on multiple restarts. Bug
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=156873 was the original issue.

> Tom.
Re: Starting Eclipse from Java [message #107149 is a reply to message #107087] Mon, 31 March 2008 16:38 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
Frank wrote:
> Hi Tom,
>
> I have created the bug report
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=224798
>
> Do you know a workaround? I need a solution this week.
>
> Thanks.
>
> Frank
>

I do not know of a workaround. If you just need to relaunch your
application could you just call EclipseStarter.run(Object) again
insetead of shutting down EclipseStarter and calling run(String[],
Runnable) again?

Tom.
Previous Topic:Export-Package header of system bundle
Next Topic:CNFE: Could not initialise class... (one for Simon K?)
Goto Forum:
  


Current Time: Tue Apr 23 07:12:40 GMT 2024

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

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

Back to the top