I originally posted my question on the answers board:
http://answers.unity3d.com/questions/8008/can-i-access-java-code-from-unity
However, I believe my problem has progressed to where a discussion would be more useful, as a straight answer is not available. Please see the answers page for an exact description of what I have tried so far (includes code).
Summarized, I have successfully converted a Java .jar file into a .net .dll using IKVM. I have then successfully accessed the .dll from a Unity3D c# script when running inside the Unity3D development environment. The problem occurs when I build a deployable version. In the deployed version, the connection to the Java code does not work. I don’t get any errors, and the deployed application works, but it is missing the on screen counter that is the result of communication with the Java code.
This is very similar to what happens if you build the example c++ plugin ( http://unity3d.com/support/resources/example-projects/texture-plugins ) for web deployment. Of course accessing c++ code from a web application isn’t supposed to work. But what is disconcerting is that a silent failure occurs. The resulting web application is built and will run, but all of the portions that need to communicate with the c++ code do not work. There are no any error messages - I’d love to see a big, giant warning if you try to compile a project that uses a c++ plugin for the web telling you it won’t work. Anybody know of any way to turn on such debugging (or where to look for the error messages)?
I’m wondering if I’m hitting a similar problem, a silent failure for something that is not going to be possible. I’m trying to think of a way that I can prove whether or not this is the case.
I would appreciate any suggestions on how to go about troubleshooting. Places to look for errors that I might not know about, debugging levels I could turn on, suggested strategies for identifying the problem…any discussion along these lines would be helpful.
As background, I am an experienced programmer (including commercial game development in other engines), but relatively new to Unity3D. So feel free to lay complex ideas on me=)
I would like to definitively prove whether it is or is not possible to access Java libraries from a deployed Unity3d application.