dcsimg
JVM launched from C++ program : problem with GUI calls
0 posts in topic
Thread View Thread View
TOPIC ACTIONS:
 

JVM launched from C++ program : problem with GUI c...
brice
Mon Apr 07, 2014 09:38 PM

Dear all,

I am a C++ programmer and I use JNI to instanciate a JVM in my application in order to use a third-party java application.

When launching the third party application directly from java, it works fine, but when I try to start it from a JVM instanciated from my C++ program, it fails with an infinite loop the first time it tries to open a dialog. All java stuff before the first java dialog is executing fine.

The strange thing is that if I add the following line at the first line of the java function invoked from C++, then the whole java library is properly executing without any problem, including all gui stuff :
javax.swing.JOptionPane.showMessageDialog(null,"Hello World from JAVA !");

For debug, it's fine like that, but for release, it's a bit odd to let this dialog...

So, maybe am I missing something in the JVM initialisation, but as the above slightly modified java library version is working, I am out of idea on what looking for ?

Does someone has an idea of what may be wrong ?

Thanks in advance,

Brice

About | Sitemap | Contact