I have two java applications (1,2), and want to run application 2 from application 1. First I tried to create a .jar file of application 2 and run it with ProcessBuilder. That worked until I wanted to search for something inside application 2, something with packages missing and stuff.
Then I thought instead I could just run application2.java from ProcessBuilder in application 1, but that doesn't seem to be the right way to do it? Now I get errors, missing packages but in a earlier stage (the application is not started at all).
I'm doing this in Ubuntu. Any tips?
Process proc = Runtime.getRuntime().exec("/bin/bash","-c","java -jar App2.jar parameters passed to the app"); // read the input stream obtained by proc.getInputStream()resources/WordNet-3.0/dict/index.sensesounds like a maven-like structure. I'm rather sure there is noresources/..directory within your jar therefore it won't be able to locate the resource. Open the app2.jar with f.e. 7-zip and see if there is a/Wordnet-3.0/dict/index.senseentry - if so, you need to modify your app2 to load the resources viagetClass().getResource("/WordNet-3.0/dict/index.sense");rather than try to load it viasrc/resources/.../src/main/resources/...structure where each file listed in this directory is copied into the jar - as you probably not use something like this, how should this get copied into the jar?