299 |
299 |
300 public List<String> getArguments() { |
300 public List<String> getArguments() { |
301 return ARGUMENTS.fetchFrom(params); |
301 return ARGUMENTS.fetchFrom(params); |
302 } |
302 } |
303 |
303 |
304 // Validation approach: |
|
305 // - javac and |
|
306 // |
|
307 // - /jmods dir |
|
308 // or |
|
309 // - JRE marker (rt.jar) |
|
310 // - FX marker (jfxrt.jar) |
|
311 // - JDK marker (tools.jar) |
|
312 private static boolean checkJDKRoot(File jdkRoot) { |
|
313 String exe = (Platform.getPlatform() == Platform.WINDOWS) ? |
|
314 ".exe" : ""; |
|
315 File javac = new File(jdkRoot, "bin/javac" + exe); |
|
316 if (!javac.exists()) { |
|
317 Log.verbose("javac is not found at " + javac.getAbsolutePath()); |
|
318 return false; |
|
319 } |
|
320 |
|
321 File jmods = new File(jdkRoot, "jmods"); |
|
322 if (!jmods.exists()) { |
|
323 Log.verbose("jmods is not found in " + jdkRoot.getAbsolutePath()); |
|
324 return false; |
|
325 } |
|
326 return true; |
|
327 } |
|
328 |
|
329 public jdk.jpackage.internal.RelativeFileSet getAppResource() { |
304 public jdk.jpackage.internal.RelativeFileSet getAppResource() { |
330 return fetchParam(APP_RESOURCES); |
305 return fetchParam(APP_RESOURCES); |
331 } |
306 } |
332 |
307 |
333 public void setAppResource(jdk.jpackage.internal.RelativeFileSet fs) { |
308 public void setAppResource(jdk.jpackage.internal.RelativeFileSet fs) { |
376 public void setIdentifier(String s) { |
351 public void setIdentifier(String s) { |
377 putUnlessNull(PARAM_IDENTIFIER, s); |
352 putUnlessNull(PARAM_IDENTIFIER, s); |
378 } |
353 } |
379 |
354 |
380 private String mainJar = null; |
355 private String mainJar = null; |
381 private String mainJarClassPath = null; |
|
382 private boolean useFXPackaging = true; |
|
383 |
|
384 // For regular executable Jars we need to take care of classpath |
|
385 // For JavaFX executable jars we do not need to pay attention to |
|
386 // ClassPath entry in manifest |
|
387 public String getAppClassPath() { |
|
388 if (mainJar == null) { |
|
389 // this will find out answer |
|
390 getMainApplicationJar(); |
|
391 } |
|
392 if (useFXPackaging || mainJarClassPath == null) { |
|
393 return ""; |
|
394 } |
|
395 return mainJarClassPath; |
|
396 } |
|
397 |
356 |
398 // assuming that application was packaged according to the rules |
357 // assuming that application was packaged according to the rules |
399 // we must have application jar, i.e. jar where we embed launcher |
358 // we must have application jar, i.e. jar where we embed launcher |
400 // and have main application class listed as main class! |
359 // and have main application class listed as main class! |
401 // If there are more than one, or none - it will be treated as |
360 // If there are more than one, or none - it will be treated as |