Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Restart codes and jni vm invocation


System.exit ends up calling exit(), so because when using JNI and we only have one process, the native launcher doesn't really have an opportunity to do the post processing for relaunch or a message box.  It may be possible to have the launcher register a vm shutdown hook to catch this, but we aren't doing this currently.

If instead of calling System.exit you can have your application return from IApplication.start (or IPlatformRunnable.run) with that return code, then it should work.

The exitdata argument is only needed when java is forked in a seperated process.  When JNI is used the exitdata is passed to the native code through a JNI call to the eclipse shared library.

-Andrew


Patrick Dempsey <pd@xxxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx

05/24/2007 05:22 PM

Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

To
equinox-dev@xxxxxxxxxxx
cc
Subject
[equinox-dev] Restart codes and jni vm invocation





When equinox/my application is started via one of the eclipse  
launchers without a -vm option specified it does not get the "-
exitdata <shared data id>" option and when I do a System.exit(<some  
exitcode>) the jvm just terminates.  When the -vm option is used with  
one of the launchers, my application gets the -exitdata <shared data  
id> and when doing System.exit() I get the expected results
RESTART_LAST_EC -> my application restarts
RESTART_NEW_EC -> application is run from the exitdata
13 -> a pop-up with the command line used to start exiting jvm is shown
any other int -> a pop-up with exitdata string is shown

Is the restart capability/pop-up windows functionality disabled when  
starting my application via jni?

Thanks
Patrick

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


Back to the top