@@ -0,0 +1,3069 @@
+%0A/**%0A * Write a description of class loadApp here.%0A * %0A * @author (Brendan Manning) %0A * @version (Revision 1)%0A */%0Aimport java.io.*;%0Apublic class loadApp%0A%7B%0A    public static void main(String%5B%5D arg) %7B%0A        //this should never be run. %0A        //in case it is though, show a copyright notice%0A        System.out.println(%22jLinux - (c) 2016 Brendan Manning%22);%0A    %7D%0A    public static boolean run(String prog, String baseDir) %7B%0A        //first disable the default shell prompt%0A        //main._enableShell(false);%0A        //create a File object to find the program%0A        String pStr = baseDir + %22applications%22 + File.separator + prog.toLowerCase() + %22.jar%22;%0A        //System.out.println(pStr);%0A        File f = new File(pStr);%0A        if (f.exists()) %7B%0A         //the program is there, run it%0A            try %7B%0A                ProcessBuilder pb = new ProcessBuilder(%22java%22, %22-jar%22, pStr);%0A                    pb.directory(new File(System.getProperty(%22java.home%22)));%0A                    Process p = pb.start();%0A                    LogStreamReader lsr = new LogStreamReader(p.getInputStream());%0A                    Thread thread = new Thread(lsr, %22LogStreamReader%22);%0A                    thread.start();%0A                    try %7B%0A                    p.waitFor();%0A                %7D catch (java.lang.InterruptedException ie) %7B%0A                    //wait%0A                    System.out.print(%22%5B fatal error %5D Program '%22 + prog.toLowerCase() + %22' created an error that jLinux can't process. Quitting...%22);%0A                    System.exit(1);%0A                %7D%0A                //code found @ http://stackoverflow.com/questions/1320476/execute-another-jar-in-a-java-program%0A            %7D catch (java.io.IOException ioex) %7B%0A                //alert the user of an error%0A                System.out.println(%22Program '%22 + prog.toLowerCase() + %22' exists but an internal error occured%22);%0A                System.out.print(%22::Error Code - %22);%0A                ioex.printStackTrace();%0A                System.out.print(%22 ::%22);%0A                return false;%0A            %7D%0A            %0A        %7D else %7B%0A            //alert user%0A            System.out.println(%22Program '%22 + prog.toLowerCase() + %22' does not exist%22);%0A            //actually nevermine to the above, because the main class should do that itself%0A            return false;%0A        %7D%0A        return true;%0A    %7D%0A%7D%0A//LogStreamreader class from user Mohammad Adil on stack Overflow%0A//post can be found here http://stackoverflow.com/questions/15700879/how-to-run-a-java-executable-jar-in-another-java-program%0Aclass LogStreamReader implements Runnable %7B%0A%0A    private BufferedReader reader;%0A%0A    public LogStreamReader(InputStream is) %7B%0A        this.reader = new BufferedReader(new InputStreamReader(is));%0A    %7D%0A%0A    public void run() %7B%0A        try %7B%0A            String line = reader.readLine();%0A            while (line != null) %7B%0A                System.out.println(line);%0A                line = reader.readLine();%0A            %7D%0A            reader.close();%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%7D%0A

Create loadApp.java