@@ -139,7 +139,8 @@ protected File doApply(Packager packager) throws Exception {
139139
140140 // gets JDK release info
141141 Map <String ,String > releaseMap = JDKUtils .getRelease (jdkPath );
142- String releaseInfo = "add:IMAGE_TYPE=\" JRE\" :OS_ARCH=\" " + releaseMap .get ("OS_ARCH" ) + "\" :OS_NAME=\" " + releaseMap .get ("OS_NAME" ) + "\" " ;
142+ assert releaseMap != null ;
143+ String releaseInfo = "add:IMAGE_TYPE=\" JRE\" :OS_ARCH=\" " + releaseMap .get ("OS_ARCH" ) + "\" :OS_NAME=\" " + releaseMap .get ("OS_NAME" ) + "\" " ;
143144
144145 // full path to jlink command
145146 File jlink = new File (currentJdk , "/bin/jlink" );
@@ -222,7 +223,7 @@ protected String getRequiredModules(File packagingJdk, File libsFolder, boolean
222223 modulesList =
223224 defaultModules
224225 .stream ()
225- .map (module -> module . trim () )
226+ .map (String :: trim )
226227 .collect (Collectors .toList ());
227228
228229 } else if (VersionUtils .getJavaMajorVersion () >= 13 ) {
@@ -235,13 +236,14 @@ protected String getRequiredModules(File packagingJdk, File libsFolder, boolean
235236 "--ignore-missing-deps" ,
236237 "--print-module-deps" ,
237238 "--add-modules=ALL-MODULE-PATH" ,
238- "--module-path=" + StringUtils .join (modulePaths , File .pathSeparator )
239+ "--module-path=" + StringUtils .join (modulePaths , File .pathSeparator ),
240+ libsFolder ,
241+ jarFile
239242 );
240243
241244 modulesList =
242- Arrays .asList (modules .split ("," ))
243- .stream ()
244- .map (module -> module .trim ())
245+ Arrays .stream (modules .split ("," ))
246+ .map (String ::trim )
245247 .filter (module -> !module .isEmpty ())
246248 .collect (Collectors .toList ());
247249
@@ -255,13 +257,14 @@ protected String getRequiredModules(File packagingJdk, File libsFolder, boolean
255257 "--ignore-missing-deps" ,
256258 "--list-deps" ,
257259 "--add-modules=ALL-MODULE-PATH" ,
258- "--module-path=" + StringUtils .join (modulePaths , File .pathSeparator )
260+ "--module-path=" + StringUtils .join (modulePaths , File .pathSeparator ),
261+ libsFolder ,
262+ jarFile
259263 );
260264
261265 modulesList =
262- Arrays .asList (modules .split ("\n " ))
263- .stream ()
264- .map (module -> module .trim ())
266+ Arrays .stream (modules .split ("\n " ))
267+ .map (String ::trim )
265268 .map (module -> (module .contains ("/" ) ? module .split ("/" )[0 ] : module ))
266269 .filter (module -> !module .isEmpty ())
267270 .filter (module -> !module .startsWith ("JDK removed internal" ))
0 commit comments