<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Java_Launcher_for_Field_Debug</id>
	<title>Java Launcher for Field Debug - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Java_Launcher_for_Field_Debug"/>
	<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Launcher_for_Field_Debug&amp;action=history"/>
	<updated>2026-06-06T23:50:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Launcher_for_Field_Debug&amp;diff=18555&amp;oldid=prev</id>
		<title>Jmay: Added zip with example application.</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Launcher_for_Field_Debug&amp;diff=18555&amp;oldid=prev"/>
		<updated>2010-05-27T08:31:02Z</updated>

		<summary type="html">&lt;p&gt;Added zip with example application.&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;â† Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:31, 27 May 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;These arguments must come before the -classpath tag, but the other launchers here simply pass all arguments to the Java application. This launcher will pass all arguments that start with &amp;#039;-X&amp;#039; to the JVM itself.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;These arguments must come before the -classpath tag, but the other launchers here simply pass all arguments to the Java application. This launcher will pass all arguments that start with &amp;#039;-X&amp;#039; to the JVM itself.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This script incorporates the &amp;#039;Strtok&amp;#039; by &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;bigmac66 &lt;/del&gt;and uses it for the command line parsing parts.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This script incorporates the &amp;#039;Strtok&amp;#039; by &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;bigmac666 &lt;/ins&gt;and uses it for the command line parsing parts.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are various calls to MessageBox in the script so you can see what each bit does. Comment them in or out as necessary.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are various calls to MessageBox in the script so you can see what each bit does. Comment them in or out as necessary.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Links ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;attach&gt;LauncherForFieldDebug.zip&amp;lt;/attach&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This zip contains a compiled version of the script, together with a sample Java Swing application to show the principles of operation. See the readme.txt file in the zip for details.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== The Script ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== The Script ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key n22049_wiki-wiki_:diff::1.12:old-18553:rev-18555 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jmay</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Launcher_for_Field_Debug&amp;diff=18553&amp;oldid=prev</id>
		<title>Jmay: Removed link to Strtok as page seems to have disappeared</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Launcher_for_Field_Debug&amp;diff=18553&amp;oldid=prev"/>
		<updated>2010-05-26T23:55:49Z</updated>

		<summary type="html">&lt;p&gt;Removed link to Strtok as page seems to have disappeared&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;â† Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:55, 26 May 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;These arguments must come before the -classpath tag, but the other launchers here simply pass all arguments to the Java application. This launcher will pass all arguments that start with &amp;#039;-X&amp;#039; to the JVM itself.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;These arguments must come before the -classpath tag, but the other launchers here simply pass all arguments to the Java application. This launcher will pass all arguments that start with &amp;#039;-X&amp;#039; to the JVM itself.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This script incorporates &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/del&gt;Strtok&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] &lt;/del&gt;by bigmac66 and uses it for the command line parsing parts.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This script incorporates &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;the &amp;#039;&lt;/ins&gt;Strtok&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039; &lt;/ins&gt;by bigmac66 and uses it for the command line parsing parts.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are various calls to MessageBox in the script so you can see what each bit does. Comment them in or out as necessary.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are various calls to MessageBox in the script so you can see what each bit does. Comment them in or out as necessary.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key n22049_wiki-wiki_:diff::1.12:old-18552:rev-18553 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jmay</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Launcher_for_Field_Debug&amp;diff=18552&amp;oldid=prev</id>
		<title>Jmay: Created page for field-debug Java Launcher</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Launcher_for_Field_Debug&amp;diff=18552&amp;oldid=prev"/>
		<updated>2010-05-26T23:52:14Z</updated>

		<summary type="html">&lt;p&gt;Created page for field-debug Java Launcher&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PageAuthor|Jmay}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This is a slightly more advanced Java launcher that builds on the ideas of the other launchers here. I&amp;#039;m indebted to their authors for coming up with the idea of using NSIS to create a Java launcher. My script just puts a bit of gloss on the basic idea. It solves a couple of problems for field-debugging of deployed applications:&lt;br /&gt;
&lt;br /&gt;
1. As Pac has said with [[A slightly better Java Launcher]], when everything is working fine, it&amp;#039;s better not to have a command prompt window showing as when running with java.exe. However, if you need to debug your application in the field, it is often very useful to have this console so you can quickly look at Log4j or System.out.println() trace. Of course, you can manually invoke your application with a batch file, but it gets rather tiresome having to specify the classpath etc. So, this launcher lets you specify &amp;#039;-console&amp;#039; as an argument to the executable. This invokes java.exe rather than javaw.exe and so causes the console to appear.&lt;br /&gt;
&lt;br /&gt;
2. Again, when debugging built applications, it is very useful to be able to attach a remote debug session to the deployed application, e.g. from Eclipse. However, in order to put the JVM into remote debug mode, you need to specify, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;â€“Xdebug â€“Xnoagent â€“Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These arguments must come before the -classpath tag, but the other launchers here simply pass all arguments to the Java application. This launcher will pass all arguments that start with &amp;#039;-X&amp;#039; to the JVM itself.&lt;br /&gt;
&lt;br /&gt;
This script incorporates [[Strtok]] by bigmac66 and uses it for the command line parsing parts.&lt;br /&gt;
&lt;br /&gt;
There are various calls to MessageBox in the script so you can see what each bit does. Comment them in or out as necessary.&lt;br /&gt;
&lt;br /&gt;
== The Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# ------------------------------------------------------------------------------&lt;br /&gt;
# Advanced Java Launcher&lt;br /&gt;
# Author: Jmay&lt;br /&gt;
# Based on: Java Launcher&lt;br /&gt;
# &lt;br /&gt;
# Thanks to bigmac666 for StrTok and all the other NSIS Java launcher&lt;br /&gt;
# developers, on whose work this is substantially based.&lt;br /&gt;
#&lt;br /&gt;
# Specify &amp;#039;-console&amp;#039; as argument to launch with java.exe, otherwise javaw.exe &lt;br /&gt;
# will be used.&lt;br /&gt;
#&lt;br /&gt;
# All arguments starting &amp;#039;-X&amp;#039; will be passed to the JVM, all other arguments &lt;br /&gt;
# will be passed to the Java application.&lt;br /&gt;
# ------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
# You want to change the next four lines&lt;br /&gt;
Name &amp;quot;YourProgramName&amp;quot;&lt;br /&gt;
Caption &amp;quot;Java Launcher&amp;quot;&lt;br /&gt;
Icon &amp;quot;YourIcon.ico&amp;quot;&lt;br /&gt;
OutFile &amp;quot;YourProgram.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
SilentInstall silent&lt;br /&gt;
AutoCloseWindow true&lt;br /&gt;
ShowInstDetails nevershow&lt;br /&gt;
&lt;br /&gt;
# You want to change the next two lines too&lt;br /&gt;
!define CLASSPATH &amp;quot;.&amp;quot;&lt;br /&gt;
!define CLASS &amp;quot;Test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!define TRUE &amp;quot;true&amp;quot;&lt;br /&gt;
!define FALSE &amp;quot;false&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# defines for console or windowed usage&lt;br /&gt;
!define USE_CONSOLE_ARG &amp;quot;-console&amp;quot;&lt;br /&gt;
!define JAVA_CONSOLE_EXE &amp;quot;java.exe&amp;quot;&lt;br /&gt;
!define JAVA_WINDOWED_EXE &amp;quot;javaw.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Var VmArgs         # JVM arguments, e.g. -Xdebug -Xnoagent, etc.&lt;br /&gt;
Var ProgramArgs    # your program arguments (if you use them), e.g. -enablefoo, etc.&lt;br /&gt;
Var C0             # temporary variable used in testing for quoted executable path&lt;br /&gt;
Var X0             # temporary variable used in testing for VM arguments&lt;br /&gt;
Var BreakLoop      # essentially a boolean to indicate loop processing should finish&lt;br /&gt;
Var JavaExe        # the Java exe to use - either java.exe or javaw.exe&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section &amp;quot;1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  StrCpy $BreakLoop ${FALSE}&lt;br /&gt;
  &lt;br /&gt;
  # set to javaw.exe by default&lt;br /&gt;
  StrCpy $JavaExe ${JAVA_WINDOWED_EXE}&lt;br /&gt;
  &lt;br /&gt;
  Call ParseArgs&lt;br /&gt;
  Call GetJRE&lt;br /&gt;
  Pop $R0&lt;br /&gt;
&lt;br /&gt;
  StrCpy $0 &amp;#039;&amp;quot;$R0&amp;quot; $VmArgs -classpath &amp;quot;${CLASSPATH}&amp;quot; ${CLASS} $ProgramArgs&amp;#039;&lt;br /&gt;
  &lt;br /&gt;
  ; MessageBox MB_OK|MB_ICONINFORMATION &amp;quot;VmArgs: $VmArgs&amp;quot;&lt;br /&gt;
  ; MessageBox MB_OK|MB_ICONINFORMATION &amp;quot;ProgramArgs: $ProgramArgs&amp;quot;&lt;br /&gt;
  MessageBox MB_OK|MB_ICONINFORMATION &amp;quot;Final cmdline: $0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  SetOutPath $EXEDIR&lt;br /&gt;
  ExecWait $0&lt;br /&gt;
SectionEnd&lt;br /&gt;
&lt;br /&gt;
Function ParseArgs&lt;br /&gt;
  # first argument is executable name; check for double quote at start, e.g. if&lt;br /&gt;
  # path contains spaces&lt;br /&gt;
  StrCpy $C0 $CMDLINE 1&lt;br /&gt;
  StrCmpS $C0 &amp;#039;&amp;quot;&amp;#039; quoted unquoted&lt;br /&gt;
  &lt;br /&gt;
  quoted:&lt;br /&gt;
    # tokenize using &amp;#039;&amp;quot;&amp;#039; as the delimiter; this fixes up the problem where paths&lt;br /&gt;
	# containing spaces break the later tokenization of arguments using &amp;#039; &amp;#039; as a delimiter&lt;br /&gt;
	&lt;br /&gt;
    ; MessageBox MB_OK|MB_ICONINFORMATION &amp;quot;Quoted string&amp;quot; &lt;br /&gt;
    ; MessageBox MB_OK|MB_ICONINFORMATION &amp;quot;Cmdline: $CMDLINE&amp;quot; &lt;br /&gt;
	&lt;br /&gt;
	# push $CMDLINE, tokenize and ignore as first token will be empty as string starts with delimiter&lt;br /&gt;
    Push $CMDLINE	&lt;br /&gt;
    Push &amp;#039;&amp;quot;&amp;#039;&lt;br /&gt;
    Call StrTok&lt;br /&gt;
	&lt;br /&gt;
    Pop $R0  # first token&lt;br /&gt;
    Pop $R1  # remainder of string&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
    # push remainder of string, tokenize and use first token as the initial argument in $ProgramArgs&lt;br /&gt;
    Push $R1&lt;br /&gt;
    Push &amp;#039;&amp;quot;&amp;#039;&lt;br /&gt;
    Call StrTok&lt;br /&gt;
	&lt;br /&gt;
    Pop $R0&lt;br /&gt;
    Pop $R1&lt;br /&gt;
	&lt;br /&gt;
    Strcpy $ProgramArgs &amp;#039;&amp;quot;$R0&amp;quot;&amp;#039;&lt;br /&gt;
    GoTo appendspace&lt;br /&gt;
  &lt;br /&gt;
  unquoted:&lt;br /&gt;
    # no special processing needed for unquoted path	&lt;br /&gt;
    ; MessageBox MB_OK|MB_ICONINFORMATION &amp;quot;Un-quoted string&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  appendspace:&lt;br /&gt;
    # append space to create trailing delimiter so can get final token, &lt;br /&gt;
	# otherwise StrTok will finish prematurely&lt;br /&gt;
    StrCpy $R1 &amp;quot;$R1 &amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  # main processing loop, uses StrTok to extract each argument in turn&lt;br /&gt;
  loop:&lt;br /&gt;
    # check loop continue flag&lt;br /&gt;
    StrCmp $BreakLoop ${TRUE} finished&lt;br /&gt;
  &lt;br /&gt;
    Push $R1&lt;br /&gt;
    Push &amp;quot; &amp;quot;&lt;br /&gt;
    Call StrTok&lt;br /&gt;
  &lt;br /&gt;
    Pop $R0&lt;br /&gt;
    Pop $R1&lt;br /&gt;
	&lt;br /&gt;
	# if token is empty string then set flag to break out of loop&lt;br /&gt;
    StrCmp $R1 &amp;quot;&amp;quot; 0 moretodo&lt;br /&gt;
    StrCpy $BreakLoop ${TRUE}&lt;br /&gt;
  &lt;br /&gt;
  moretodo:&lt;br /&gt;
  &lt;br /&gt;
    ; MessageBox MB_OK|MB_ICONINFORMATION &amp;quot;loop - R0: $R0&amp;quot;&lt;br /&gt;
    ; MessageBox MB_OK|MB_ICONINFORMATION &amp;quot;loop - R1: $R1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
    # check whether user specified &amp;#039;-console&amp;#039;&lt;br /&gt;
    StrCmpS $R0 &amp;quot;-console&amp;quot; usingconsole vmorprogramarg&lt;br /&gt;
  &lt;br /&gt;
  usingconsole:&lt;br /&gt;
    # set to java.exe&lt;br /&gt;
    StrCpy $JavaExe ${JAVA_CONSOLE_EXE}&lt;br /&gt;
    GoTo loop&lt;br /&gt;
  &lt;br /&gt;
  vmorprogramarg:&lt;br /&gt;
    # check start of arg to see if is a VM arg or program arg&lt;br /&gt;
    StrCpy $X0 $R0 2&lt;br /&gt;
    StrCmpS $X0 &amp;quot;-X&amp;quot; isvmarg isprogramarg&lt;br /&gt;
  &lt;br /&gt;
  isvmarg:&lt;br /&gt;
    # is a VM arg; append to $VmArgs&lt;br /&gt;
    StrCpy $VmArgs &amp;quot;$VmArgs $R0&amp;quot;&lt;br /&gt;
    GoTo loop&lt;br /&gt;
  &lt;br /&gt;
  isprogramarg:&lt;br /&gt;
    # is a program arg; append to $ProgramArgs&lt;br /&gt;
    StrCpy $ProgramArgs &amp;quot;$ProgramArgs $R0&amp;quot;  &lt;br /&gt;
    GoTo loop&lt;br /&gt;
  &lt;br /&gt;
  finished:&lt;br /&gt;
    ClearErrors&lt;br /&gt;
  &lt;br /&gt;
FunctionEnd&lt;br /&gt;
&lt;br /&gt;
# Find JRE (java(w).exe)&lt;br /&gt;
# 1 - in .\jre directory (JRE Installed with application)&lt;br /&gt;
# 2 - in JAVA_HOME environment variable&lt;br /&gt;
# 3 - in the registry&lt;br /&gt;
# 4 - assume java(w).exe in current dir or PATH&lt;br /&gt;
Function GetJRE&lt;br /&gt;
&lt;br /&gt;
  Push $R0&lt;br /&gt;
  Push $R1&lt;br /&gt;
&lt;br /&gt;
  ClearErrors&lt;br /&gt;
&lt;br /&gt;
  StrCpy $R0 &amp;quot;$EXEDIR\jre\bin\$JavaExe&amp;quot;&lt;br /&gt;
  ; MessageBox MB_OK|MB_ICONINFORMATION &amp;quot;Looking in JRE for: $R0&amp;quot;&lt;br /&gt;
  IfFileExists $R0 JreFound&lt;br /&gt;
  StrCpy $R0 &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  ClearErrors&lt;br /&gt;
  ReadEnvStr $R0 &amp;quot;JAVA_HOME&amp;quot;&lt;br /&gt;
  StrCpy $R0 &amp;quot;$R0\bin\$JavaExe&amp;quot;&lt;br /&gt;
  IfErrors 0 JreFound&lt;br /&gt;
&lt;br /&gt;
  ClearErrors&lt;br /&gt;
  ReadRegStr $R1 HKLM &amp;quot;SOFTWARE\JavaSoft\Java Runtime Environment&amp;quot; &amp;quot;CurrentVersion&amp;quot;&lt;br /&gt;
  ReadRegStr $R0 HKLM &amp;quot;SOFTWARE\JavaSoft\Java Runtime Environment\$R1&amp;quot; &amp;quot;JavaHome&amp;quot;&lt;br /&gt;
  StrCpy $R0 &amp;quot;$R0\bin\$JavaExe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  IfErrors 0 JreFound&lt;br /&gt;
  StrCpy $R0 &amp;quot;$JavaExe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 JreFound:&lt;br /&gt;
  Pop $R1&lt;br /&gt;
  Exch $R0&lt;br /&gt;
FunctionEnd&lt;br /&gt;
&lt;br /&gt;
# C-style StrTok function&lt;br /&gt;
# Author: bigmac666&lt;br /&gt;
Function StrTok&lt;br /&gt;
  Exch $R1&lt;br /&gt;
  Exch 1&lt;br /&gt;
  Exch $R0&lt;br /&gt;
  Push $R2&lt;br /&gt;
  Push $R3&lt;br /&gt;
  Push $R4&lt;br /&gt;
  Push $R5&lt;br /&gt;
&lt;br /&gt;
  #R0 fullstring&lt;br /&gt;
  #R1 tokens&lt;br /&gt;
  #R2 len of fullstring&lt;br /&gt;
  #R3 len of tokens&lt;br /&gt;
  #R4 char from string&lt;br /&gt;
  #R5 testchar&lt;br /&gt;
&lt;br /&gt;
  StrLen $R2 $R0&lt;br /&gt;
  IntOp $R2 $R2 + 1&lt;br /&gt;
&lt;br /&gt;
  loop1:&lt;br /&gt;
    IntOp $R2 $R2 - 1&lt;br /&gt;
    IntCmp $R2 0 exit&lt;br /&gt;
&lt;br /&gt;
    StrCpy $R4 $R0 1 -$R2&lt;br /&gt;
&lt;br /&gt;
    StrLen $R3 $R1&lt;br /&gt;
    IntOp $R3 $R3 + 1&lt;br /&gt;
&lt;br /&gt;
    loop2:&lt;br /&gt;
      IntOp $R3 $R3 - 1&lt;br /&gt;
      IntCmp $R3 0 loop1&lt;br /&gt;
&lt;br /&gt;
      StrCpy $R5 $R1 1 -$R3&lt;br /&gt;
&lt;br /&gt;
      StrCmp $R4 $R5 Found&lt;br /&gt;
    Goto loop2&lt;br /&gt;
  Goto loop1&lt;br /&gt;
&lt;br /&gt;
  exit:&lt;br /&gt;
  # Not found!!!&lt;br /&gt;
  StrCpy $R1 &amp;quot;&amp;quot;&lt;br /&gt;
  StrCpy $R0 &amp;quot;&amp;quot;&lt;br /&gt;
  Goto Cleanup&lt;br /&gt;
&lt;br /&gt;
  Found:&lt;br /&gt;
  StrLen $R3 $R0&lt;br /&gt;
  IntOp $R3 $R3 - $R2&lt;br /&gt;
  StrCpy $R1 $R0 $R3&lt;br /&gt;
&lt;br /&gt;
  IntOp $R2 $R2 - 1&lt;br /&gt;
  IntOp $R3 $R3 + 1&lt;br /&gt;
  StrCpy $R0 $R0 $R2 $R3&lt;br /&gt;
&lt;br /&gt;
  Cleanup:&lt;br /&gt;
  Pop $R5&lt;br /&gt;
  Pop $R4&lt;br /&gt;
  Pop $R3&lt;br /&gt;
  Pop $R2&lt;br /&gt;
  Exch $R0&lt;br /&gt;
  Exch 1&lt;br /&gt;
  Exch $R1&lt;br /&gt;
&lt;br /&gt;
FunctionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Code Examples]]&lt;br /&gt;
[[Category:Java]]&lt;/div&gt;</summary>
		<author><name>Jmay</name></author>
	</entry>
</feed>