How to open a jar (that reads a .properties file) with another jar

0

I have developed an application for the "Visitors Registry", this application connects to MySQL to save the records, to determine which base to connect to obtain this parameter from a Properties file. The application works by itself without problems.

The problem arises when wanting to open this application from another app. It tells me that it does not locate the properties file. The code I use to open the jar from another jar is the following:

public static void main(String[] args) {
    String cmd = "java -jar C:/Users/adnk1/Desktop/AccessControl14-12-2018/AccessControlProduccion.jar";
  try {
        Process p = Runtime.getRuntime().exec(cmd);
        BufferedReader in = new BufferedReader(
                            new InputStreamReader(p.getInputStream()));
        String line = null;
        while ((line = in.readLine()) != null) {
            System.out.println(line);
        }
    } catch (IOException e) {
        e.printStackTrace();
    } 
}

I try to make this app in order to consult another database if there is any update of the "Visitor Registration" application.

I would like to know if I am omitting something, because as I mentioned the application of "Visitor Registration" works by itself, so I guess something is missing in the jar programming that opens the other jar. Greetings.

    
asked by Adán López 17.12.2018 в 05:14
source

0 answers