spawning a java process from C++

I have asked, on another website, how to open a JAR file from C++, and one of the responses was to use system("java -jar myJavaProgram.jar"); and I responded: "I would, but system() is evil. Please read this: for more information" I hope I was right in telling them this, as the program I am writing will access the Clipboard in Windows. I remember reading, in that article, that Linux-users using system() should be careful about writing the program for users with set-user-ID/set-group-ID privileges, but this program being for Windows-users (all I know for right now), I am wondering if the same rule applies. Also, would using system() for a Java program be the equivalent of gouging out the eyes (and breaking the arm of) of an attacker who simply grabs you?
Search on JNI, specifically on JNI_CreateJavaVM(). You can host a Java VM inside a native application.
Topic archived. No new replies allowed.