3 Replies Latest reply: May 3, 2013 3:55 PM by jsmith RSS

    JavaFx Image Bundle Deployment

    ericC
      Hi All,

      Is there way to dundle up multiple projects(apps) into one image? Basically I would like to deploy mutltiple apps with one instanceof runtime(jre).

      Thanks.
        • 1. Re: JavaFx Image Bundle Deployment
          KevinPas
          One possibility:

          1) See if the other app is already running:

          // The following only works in Windows.
          // Something like this might work in Linux: String command="ps -A -U "+System.getProperty("user.name")+" -d";
          String line;
          Process p = Runtime.getRuntime().exec("tasklist.exe /FI \"IMAGENAME eq " + "myOtherApp" + "\"");
          BufferedReader input = new BufferedReader (new InputStreamReader(p.getInputStream()));
          while ((line = input.readLine()) != null) {
          if ( line.contains( "myOtherApp" ) ) {
          alreadyLoaded = true; // Already Loaded.
          break;
          }
          }

          if ( alreadyLoaded == false )
          {
          // path and parameters to other app
          otherProcess = Runtime.getRuntime().exec( path + " -m -d -t" );
          bResult = true;
          }

          2) otherProcess .destroy ();

          Edited by: KevinPas on May 1, 2013 9:41 AM

          Edited by: KevinPas on May 1, 2013 9:42 AM
          • 2. Re: JavaFx Image Bundle Deployment
            ericC
            Sorry if I did not explain my problem clearly. The question is NOT about how to force to run only one instance of application.

            For JavaFX deployment, you can bundle java runtime and applcation into an image (folder)
            i.e
            my_app:
            app
            --my_app.jar
            runtime
            my_app.exe

            So my question is there a way that I can deploy multple applications into one image (just one instance of runtime)

            something like
            my_system:
            app1
            --app1.jar
            app2
            --app2.jar
            runtime
            app1.exe
            app2.exe

            Edited by: ericC on May 3, 2013 1:41 PM

            Edited by: ericC on May 3, 2013 1:42 PM
            • 3. Re: JavaFx Image Bundle Deployment
              jsmith
              There is a reference to an undocumented feature (<fx:platform basedir=""/>) in this blog under the heading "Self-Contained Applications: Create Package without Java Runtime", perhaps that might help you?

              https://blogs.oracle.com/talkingjavadeployment/entry/packaging_improvements_in_jdk_7#2