I have a python app and java app. The python app generates input for the java app and invokes it on the command line.
I\'m sure there must be a more elegant solution
Take a look at Jython. It's kind of like JNI, but replace C with Python, i.e. you can call Python from Java and vice versa. It's not totally clear what you're trying to do or why your current approach isn't what you want.