Суть проблемы: с помощью jni я создаю окружение и джава машину, которая работает с этим окружением и с моим джава классом, который я вызываю уже из С++
для того что бы создать джава машину используется функция CreateJavaVM (&jvm, (void**)&env, &args)
делаю все что нужно и вызываю DestroyJavaVM();
все работает, но когда пытаюсь запустить новую джава машину для других действий CreateJavaVM возвращает -1
по отдельности блоки типа
CreateJavaVM() делаем что-то DestroyJavaVM()
работают, но по очереди нет. в комьюнити оракла пишут
The support for DestroyJavaVM was not complete in 1.1. Only the main thread may call DestroyJavaVM. In the Java 2 SDK, any thread, whether attached or not, can call this function. If the current thread is attached, the VM waits until the current thread is the only user-level Java thread. If the current thread is not attached, the VM attaches the current thread and then waits until the current thread is the only user-level thread. The Java 2 SDK still does not support VM unloading, however. DestroyJavaVM always returns an error code.
но я не могу сделать из этого выводов.