< prev index next >

modules/fxpackager/src/main/java/com/oracle/tools/packager/linux/LinuxAppBundler.java

Print this page

        

@@ -246,11 +246,11 @@
 
         // Generate launcher .cfg file
         if (LAUNCHER_CFG_FORMAT.fetchFrom(p).equals(CFG_FORMAT_PROPERTIES)) {
             writeCfgFile(p, rootDir);
         } else {
-            writeCfgFile(p, new File(rootDir, getLauncherCfgName(p)), "$APPDIR/runtime");
+            writeCfgFile(p, new File(rootDir, getLauncherCfgName(p)), getRuntimeLocation(p));
         }
     }
 
     private void copyApplication(Map<String, ? super Object> params, File appDirectory) throws IOException {
         List<RelativeFileSet> appResourcesList = APP_RESOURCES_LIST.fetchFrom(params);

@@ -267,20 +267,24 @@
                         new File(srcdir, fname), new File(appDirectory, fname));
             }
         }
     }
 
+    private String getRuntimeLocation(Map<String, ? super Object> params) {
+        if (LINUX_RUNTIME.fetchFrom(params) == null) {
+            return "";
+        } else {
+            return "$APPDIR/runtime";
+        }
+    }
+
     private void writeCfgFile(Map<String, ? super Object> params, File rootDir) throws FileNotFoundException {
         File cfgFile = new File(rootDir, getLauncherCfgName(params));
 
         cfgFile.delete();
         PrintStream out = new PrintStream(cfgFile);
-        if (LINUX_RUNTIME.fetchFrom(params) == null) {
-            out.println("app.runtime=");                    
-        } else {
-            out.println("app.runtime=$APPDIR/runtime");
-        }
+        out.println("app.runtime=" + getRuntimeLocation(params));
         out.println("app.mainjar=" + MAIN_JAR.fetchFrom(params).getIncludedFiles().iterator().next());
         out.println("app.version=" + VERSION.fetchFrom(params));
 
         //use '/' in the class name (instead of '.' to simplify native code
         out.println("app.mainclass=" +
< prev index next >