Running Java

Is it possible to use Python to get a small little Java app to run embedded inside a Blender window?

I know this isn’t an answer, but it might be worth mentioning. For the Sunflow export script we use a button in the script to run a command prompt which then runs the .jar (Sunflow is written in Java). The program runs outside of Blender though. WIth “system” it doesn’t allow you to run Blender while the java is doing it’s thing, but using subprocess, it runs the program on it’s own. You can see the script here where I added on line 1782 both these commands.

I doubt very much - but python could launch some java app I suppose

But it is possible to run Blender as a network server, and then write a Java app that connects to it. You could even use XML-RPC if so inclined, but I’ve never taken it that far.

Either way you end up having to write at least a certain amount of Python (and Blender’s net stablility for this always get’s a little uncertain thanks to Python being inside Blender’s process, and Python’s threading model not really helping).

The only real use I’ve had for wanting to connect to Java (the network thing has always been remote control - say web front ends and so on) is exports where I want to use DataOutputStream a lot, and create a hideously complex data structure before doing so (such that Eclipse becomes very handy). In that case it’s easier to export an XML of the required data, then load it into the Java app, and go from there.

btw I’ve done the above using the Python Twisted library (which really appears to frighten Blender a lot - but it’s absolutely fantastic to write apps with) and SimpleHTTPServer which you should find in your Python standard library.