< prev index next >

modules/fxpackager/src/main/java/jdk/packager/builders/AbstractAppImageBuilder.java

Print this page

        

@@ -177,11 +177,11 @@
 
         if (mainJar != null) {
             mainJarType = new Module(mainJar).getModuleType();
         }
 
-        String mainModule = JLinkBundlerHelper.MAIN_MODULE.fetchFrom(params);
+        String mainModule = JLinkBundlerHelper.MODULE.fetchFrom(params);
 
         PrintStream out = new PrintStream(cfgFileName);
 
         out.println("[Application]");
         out.println("app.name=" + APP_NAME.fetchFrom(params));

@@ -192,33 +192,32 @@
         out.println("app.classpath=" + String.join(File.pathSeparator, CLASSPATH.fetchFrom(params).split("[ :;]")));
 
         // The main app is required to be a jar, modular or unnamed.
         if (mainJarType == Module.ModuleType.Unknown || mainJarType == Module.ModuleType.ModularJar) {
             if (mainModule != null) {
-                out.println("app.mainmodule=" + mainModule);
+                out.println("app.mainmodule=" + mainModule); // TODO get app class from main module mainifest.
             }
         }
         else {
             String mainClass = JLinkBundlerHelper.getMainClass(params);
 
             if (mainJar != null && mainClass != null) {
-                // If the app is contained in an unnamed jar then launch it the old
-                // fashioned way and the main class string must be of the format com/foo/Main
+                // If the app is contained in an unnamed jar then launch it the
+                // legacy way and the main class string must be of the format com/foo/Main
                 out.println("app.mainclass=" + mainClass.replaceAll("\\.", "/"));
                 out.println("app.mainjar=" + mainJar);
             }
         }
 
+        out.println("packager.java.version=" + System.getProperty("java.version"));
+
         Integer port = JLinkBundlerHelper.DEBUG_PORT.fetchFrom(params);
 
         if (port != null) {
             out.println("app.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:" + port);
         }
 
-        //TODO this is a little tricky now with a modular JDK.
-        //out.println("app.java.version=" + );
-
         if (appCDEnabled) {
             out.println("app.appcds.cache=" + appCDSCacheMode.split("\\+")[0]);
         }
 
 
< prev index next >