|  | 
| 27 | 27 |  */ | 
| 28 | 28 | public class Jre { | 
| 29 | 29 | 
 | 
| 30 |  | -	/** | 
| 31 |  | -	 * Use this property when you are bundling a jre with your application. It holds the path to the jre. | 
| 32 |  | -	 * If relative, this path is from the executable. | 
| 33 |  | -	 * <p> | 
| 34 |  | -	 * If you specify path only and not minVersion, then the executable will show an error if the jre is not found. | 
| 35 |  | -	 * <p> | 
| 36 |  | -	 * If you specify path along with minVersion, then the executable will check the path first, and if no jre | 
| 37 |  | -	 * is found there, it will search the local system for a jre matching minVersion. If it still doesn't | 
| 38 |  | -	 * find anything, it will show the java download page. You may also specify maxVersion to further | 
| 39 |  | -	 * constrain the search. | 
| 40 |  | -	 */ | 
| 41 |  | -	String path; | 
| 42 |  | - | 
| 43 |  | -	/** | 
| 44 |  | -	 * Use this property if you want the executable to search the system for a jre. | 
| 45 |  | -	 * It names the minimum version acceptable, in x.x.x[_xx] format. | 
| 46 |  | -	 * <p> | 
| 47 |  | -	 * If you specify this property without giving a path, then the executable will search for a jre | 
| 48 |  | -	 * and, none is found, display the java download page. | 
| 49 |  | -	 * <p> | 
| 50 |  | -	 * If you include a path also, the executable will try that path before searching for jre matching minVersion. | 
| 51 |  | -	 * <p> | 
| 52 |  | -	 * In either case, you can also specify a maxVersion. | 
| 53 |  | -	 */ | 
| 54 |  | -	String minVersion; | 
| 55 |  | - | 
| 56 |  | -	/** | 
| 57 |  | -	 * If you specify minVersion, you can also use maxVersion to further constrain the search for a jre. | 
| 58 |  | -	 * This property should be in the format x.x.x[_xx]. | 
| 59 |  | -	 */ | 
| 60 |  | -	String maxVersion; | 
| 61 |  | - | 
| 62 |  | -	/** | 
| 63 |  | -	 * Allows you to specify a preference for a public JRE or a private JDK runtime. | 
| 64 |  | -	 * <p> | 
| 65 |  | -	 * Valid values are: | 
| 66 |  | -	 * <table border="1"> | 
| 67 |  | -	 * 	<tr> | 
| 68 |  | -	 *   <td>jreOnly</td> | 
| 69 |  | -	 *   <td>Always use a public JRE</td> | 
| 70 |  | -	 *  </tr> | 
| 71 |  | -	 *  <tr> | 
| 72 |  | -	 *   <td>preferJre</td> | 
| 73 |  | -	 *   <td>Prefer a public JRE, but use a JDK private runtime if it is newer than the public JRE</td> | 
| 74 |  | -	 *  </tr> | 
| 75 |  | -	 *  <tr> | 
| 76 |  | -	 *   <td>preferJdk</td> | 
| 77 |  | -	 *   <td>Prefer a JDK private runtime, but use a public JRE if it is newer than the JDK</td> | 
| 78 |  | -	 *  </tr> | 
| 79 |  | -	 *  <tr> | 
| 80 |  | -	 *   <td>jdkOnly</td> | 
| 81 |  | -	 *   <td>Always use a private JDK runtime (fails if there is no JDK installed)</td> | 
| 82 |  | -	 *  </tr> | 
| 83 |  | -	 * </table> | 
| 84 |  | -	 */ | 
| 85 |  | -	@Parameter(defaultValue="preferJre") | 
| 86 |  | -	String jdkPreference; | 
| 87 |  | - | 
| 88 |  | -	/** | 
| 89 |  | -	 * Sets java's initial heap size in MB, like the -Xms flag. | 
| 90 |  | -	 */ | 
| 91 |  | -	int initialHeapSize; | 
| 92 |  | - | 
| 93 |  | -	/** | 
| 94 |  | -	 * Sets java's initial heap size in percent of free memory. | 
| 95 |  | -	 */ | 
| 96 |  | -	int initialHeapPercent; | 
| 97 |  | - | 
| 98 |  | -	/** | 
| 99 |  | -	 * Sets java's maximum heap size in MB, like the -Xmx flag. | 
| 100 |  | -	 */ | 
| 101 |  | -	int maxHeapSize; | 
| 102 |  | - | 
| 103 |  | -	/** | 
| 104 |  | -	 * Sets java's maximum heap size in percent of free memory. | 
| 105 |  | -	 */ | 
| 106 |  | -	int maxHeapPercent; | 
| 107 |  | - | 
| 108 |  | -	/** | 
| 109 |  | -	 * Use this to pass arbitrary options to the java/javaw program. | 
| 110 |  | -	 * For instance, you can say: | 
| 111 |  | -	 * <pre> | 
| 112 |  | -	 * <opt>-Dlaunch4j.exedir="%EXEDIR%"</opt> | 
| 113 |  | -	 * <opt>-Dlaunch4j.exefile="%EXEFILE%"</opt> | 
| 114 |  | -	 * <opt>-Denv.path="%Path%"</opt> | 
| 115 |  | -	 * <opt>-Dsettings="%HomeDrive%%HomePath%\\settings.ini"</opt> | 
| 116 |  | -	 * </pre> | 
| 117 |  | -	 */ | 
| 118 |  | -	List<String> opts; | 
|  | 30 | +    /** | 
|  | 31 | +     * Use this property when you are bundling a jre with your application. It holds the path to the jre. | 
|  | 32 | +     * If relative, this path is from the executable. | 
|  | 33 | +     * <p> | 
|  | 34 | +     * If you specify path only and not minVersion, then the executable will show an error if the jre is not found. | 
|  | 35 | +     * <p> | 
|  | 36 | +     * If you specify path along with minVersion, then the executable will check the path first, and if no jre | 
|  | 37 | +     * is found there, it will search the local system for a jre matching minVersion. If it still doesn't | 
|  | 38 | +     * find anything, it will show the java download page. You may also specify maxVersion to further | 
|  | 39 | +     * constrain the search. | 
|  | 40 | +     */ | 
|  | 41 | +    String path; | 
|  | 42 | + | 
|  | 43 | +    /** | 
|  | 44 | +     * Use this property if you want the executable to search the system for a jre. | 
|  | 45 | +     * It names the minimum version acceptable, in x.x.x[_xx] format. | 
|  | 46 | +     * <p> | 
|  | 47 | +     * If you specify this property without giving a path, then the executable will search for a jre | 
|  | 48 | +     * and, none is found, display the java download page. | 
|  | 49 | +     * <p> | 
|  | 50 | +     * If you include a path also, the executable will try that path before searching for jre matching minVersion. | 
|  | 51 | +     * <p> | 
|  | 52 | +     * In either case, you can also specify a maxVersion. | 
|  | 53 | +     */ | 
|  | 54 | +    String minVersion; | 
|  | 55 | + | 
|  | 56 | +    /** | 
|  | 57 | +     * If you specify minVersion, you can also use maxVersion to further constrain the search for a jre. | 
|  | 58 | +     * This property should be in the format x.x.x[_xx]. | 
|  | 59 | +     */ | 
|  | 60 | +    String maxVersion; | 
|  | 61 | + | 
|  | 62 | +    /** | 
|  | 63 | +     * Allows you to specify a preference for a public JRE or a private JDK runtime. | 
|  | 64 | +     * <p> | 
|  | 65 | +     * Valid values are: | 
|  | 66 | +     * <table border="1"> | 
|  | 67 | +     * <tr> | 
|  | 68 | +     * <td>jreOnly</td> | 
|  | 69 | +     * <td>Always use a public JRE</td> | 
|  | 70 | +     * </tr> | 
|  | 71 | +     * <tr> | 
|  | 72 | +     * <td>preferJre</td> | 
|  | 73 | +     * <td>Prefer a public JRE, but use a JDK private runtime if it is newer than the public JRE</td> | 
|  | 74 | +     * </tr> | 
|  | 75 | +     * <tr> | 
|  | 76 | +     * <td>preferJdk</td> | 
|  | 77 | +     * <td>Prefer a JDK private runtime, but use a public JRE if it is newer than the JDK</td> | 
|  | 78 | +     * </tr> | 
|  | 79 | +     * <tr> | 
|  | 80 | +     * <td>jdkOnly</td> | 
|  | 81 | +     * <td>Always use a private JDK runtime (fails if there is no JDK installed)</td> | 
|  | 82 | +     * </tr> | 
|  | 83 | +     * </table> | 
|  | 84 | +     */ | 
|  | 85 | +    @Parameter(defaultValue = "preferJre") | 
|  | 86 | +    String jdkPreference; | 
|  | 87 | + | 
|  | 88 | +    /** | 
|  | 89 | +     * Sets java's initial heap size in MB, like the -Xms flag. | 
|  | 90 | +     */ | 
|  | 91 | +    int initialHeapSize; | 
|  | 92 | + | 
|  | 93 | +    /** | 
|  | 94 | +     * Sets java's initial heap size in percent of free memory. | 
|  | 95 | +     */ | 
|  | 96 | +    int initialHeapPercent; | 
|  | 97 | + | 
|  | 98 | +    /** | 
|  | 99 | +     * Sets java's maximum heap size in MB, like the -Xmx flag. | 
|  | 100 | +     */ | 
|  | 101 | +    int maxHeapSize; | 
|  | 102 | + | 
|  | 103 | +    /** | 
|  | 104 | +     * Sets java's maximum heap size in percent of free memory. | 
|  | 105 | +     */ | 
|  | 106 | +    int maxHeapPercent; | 
|  | 107 | + | 
|  | 108 | +    /** | 
|  | 109 | +     * Use this to pass arbitrary options to the java/javaw program. | 
|  | 110 | +     * For instance, you can say: | 
|  | 111 | +     * <pre> | 
|  | 112 | +     * <opt>-Dlaunch4j.exedir="%EXEDIR%"</opt> | 
|  | 113 | +     * <opt>-Dlaunch4j.exefile="%EXEFILE%"</opt> | 
|  | 114 | +     * <opt>-Denv.path="%Path%"</opt> | 
|  | 115 | +     * <opt>-Dsettings="%HomeDrive%%HomePath%\\settings.ini"</opt> | 
|  | 116 | +     * </pre> | 
|  | 117 | +     */ | 
|  | 118 | +    List<String> opts; | 
| 119 | 119 | 
 | 
| 120 | 120 |     /** | 
| 121 | 121 |      * Sets JVM version to use: 32 bits, 64 bits or 64/32 bits | 
| 122 | 122 |      * Possible values: 32, 64, 64/32 - it will fallback to default value if different option was used | 
| 123 | 123 |      * Default value is: 64/32 | 
| 124 | 124 |      */ | 
| 125 |  | -    @Parameter(defaultValue="64/32") | 
|  | 125 | +    @Parameter(defaultValue = "64/32") | 
| 126 | 126 |     String runtimeBits; | 
| 127 | 127 | 
 | 
| 128 |  | -	net.sf.launch4j.config.Jre toL4j() { | 
| 129 |  | -		net.sf.launch4j.config.Jre ret = new net.sf.launch4j.config.Jre(); | 
| 130 |  | - | 
| 131 |  | -		ret.setPath(path); | 
| 132 |  | -		ret.setMinVersion(minVersion); | 
| 133 |  | -		ret.setMaxVersion(maxVersion); | 
| 134 |  | -		ret.setJdkPreference(jdkPreference); | 
| 135 |  | -		ret.setInitialHeapSize(initialHeapSize); | 
| 136 |  | -		ret.setInitialHeapPercent(initialHeapPercent); | 
| 137 |  | -		ret.setMaxHeapSize(maxHeapSize); | 
| 138 |  | -		ret.setMaxHeapPercent(maxHeapPercent); | 
| 139 |  | -		ret.setOptions(opts); | 
|  | 128 | +    net.sf.launch4j.config.Jre toL4j() { | 
|  | 129 | +        net.sf.launch4j.config.Jre ret = new net.sf.launch4j.config.Jre(); | 
|  | 130 | + | 
|  | 131 | +        ret.setPath(path); | 
|  | 132 | +        ret.setMinVersion(minVersion); | 
|  | 133 | +        ret.setMaxVersion(maxVersion); | 
|  | 134 | +        ret.setJdkPreference(jdkPreference); | 
|  | 135 | +        ret.setInitialHeapSize(initialHeapSize); | 
|  | 136 | +        ret.setInitialHeapPercent(initialHeapPercent); | 
|  | 137 | +        ret.setMaxHeapSize(maxHeapSize); | 
|  | 138 | +        ret.setMaxHeapPercent(maxHeapPercent); | 
|  | 139 | +        ret.setOptions(opts); | 
| 140 | 140 |         ret.setRuntimeBits(runtimeBits); | 
| 141 | 141 | 
 | 
| 142 |  | -		return ret; | 
| 143 |  | -	} | 
|  | 142 | +        return ret; | 
|  | 143 | +    } | 
| 144 | 144 | 
 | 
| 145 | 145 |     @Override | 
| 146 | 146 |     public String toString() { | 
|  | 
0 commit comments