<div dir="ltr">Hi Wayne,<div><br></div><div><span style="font-size:12.8000001907349px">> The shell script launcher at</span><br style="font-size:12.8000001907349px">><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">>     </span><a href="https://github.com/tofi86/universalJavaApplicationStub" rel="noreferrer" style="font-size:12.8000001907349px" target="_blank">https://github.com/tofi86/universalJavaApplicationStub</a><br style="font-size:12.8000001907349px">><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> appears to work well.</span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div>Thanks for the pointer, and apologies for the delay in reply.</div><div><br></div><div>It is a cool project. My main concerns are:</div><div><br></div><div>* It is not Oracle's official deployment strategy. But we could very likely hack the JavaFX build to overwrite the stock launcher with this one.</div><div><br></div><div>* It is specific to OS X. So it solves the problem of passing JVM args for OS X only, but not for Windows or Linux. Of course, we want a solution that works for all supported platforms.</div><div><br></div><div>But we'll definitely keep it in mind as we migrate ImageJ2 towards Java 8 in the next couple of months.</div><div><br></div><div>Regards,</div><div>Curtis</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 22, 2015 at 12:51 PM, Rasband, Wayne (NIH/NIMH) [E] <span dir="ltr"><<a href="mailto:rasbandw@mail.nih.gov" target="_blank">rasbandw@mail.nih.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Curtis,<br>
<br>
The shell script launcher at<br>
<br>
    <a href="https://github.com/tofi86/universalJavaApplicationStub" rel="noreferrer" target="_blank">https://github.com/tofi86/universalJavaApplicationStub</a><br>
<br>
appears to work well. I was able to modify it to use a bundled JRE, pass JVM args and set the working directory so that ImageJ finds the plugins folder. There is an ImageJ distribution at<br>
<br>
    <a href="http://wsr.imagej.net/download/ImageJ-osx-java8.zip" rel="noreferrer" target="_blank">http://wsr.imagej.net/download/ImageJ-osx-java8.zip</a><br>
<br>
that uses it.<br>
<span><font color="#888888"><br>
-wayne<br>
</font></span><div><div><br>
<br>
> On Jun 18, 2015, at 12:17 PM, Curtis Rueden <<a href="mailto:ctrueden@WISC.EDU" target="_blank">ctrueden@WISC.EDU</a>> wrote:<br>
><br>
> Hi Wayne,<br>
><br>
> > Running mvn a couple of times resolved the issue.<br>
><br>
> Great.<br>
><br>
> > The next two issues are how to tell ImageJ where the plugins folder is<br>
> > and how to set the memory limit. Is there a way to define in<br>
> > Info.plist a "plugins.dir” property with the value “$APPDIR", which I<br>
> > assume is the directory containing ImageJ.app?<br>
><br>
> The way the JavaFX launcher works is that it picks up any JVM settings from the Java Preferences API at launch time. And all arguments passed on the CLI go straight to the main method args. So we will be updating ImageJ2 over the summer to process args on the Java side that were previously handled by the launcher, including -Dfoo style system property settings (since in most cases it is fine to set them early in the application startup). Of course, not all args will be possible to support this way—e.g. max heap size (but see below).<br>
><br>
> Unfortunately, the current JavaFX launcher does not yet have a means to dynamically pass JVM args to Java itself. I have an SO issue posted about it [1] as well as a bug report in to Oracle (still under review; no public URL yet). Maybe the JavaFX team will add a way, since this packaging mechanism is being actively maintained and developed. But really it is not that urgent, since you can run "java -Dplugins.dir=... -jar ImageJ.jar" or whatever from the CLI as a developer. I.e.: the native launchers maybe do not need those features. Regardless, we will also add shell scripts to make common workflows (e.g., remote debugging) as simple as possible.<br>
><br>
> From a user standpoint, for things like max heap size, there is a nice UserJvmOptionsService API [2] that we will use to expose common JVM settings in an options dialog box. It lets you set arbitrary arguments to pass to java (stored via the Java Preferences API) which take effect the next time the application is launched.<br>
><br>
> See also imagej/imagej-launcher#33 on GitHub [3].<br>
><br>
> Regards,<br>
> Curtis<br>
><br>
> [1] <a href="http://stackoverflow.com/q/30809330/1207769" rel="noreferrer" target="_blank">http://stackoverflow.com/q/30809330/1207769</a><br>
> [2] <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/jvm_options_api.html" rel="noreferrer" target="_blank">http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/jvm_options_api.html</a><br>
> [3] <a href="https://github.com/imagej/imagej-launcher/issues/33" rel="noreferrer" target="_blank">https://github.com/imagej/imagej-launcher/issues/33</a><br>
><br>
> On Thu, Jun 18, 2015 at 10:30 AM, Rasband, Wayne (NIH/NIMH) [E] <<a href="mailto:rasbandw@mail.nih.gov" target="_blank">rasbandw@mail.nih.gov</a>> wrote:<br>
> Hi Curtis,<br>
><br>
> Running mvn a couple of times resolved the issue. The next two issues are how to tell ImageJ where the plugins folder is and how to set the memory limit. Is there a way to define in Info.plist a "plugins.dir” property with the value “$APPDIR", which I assume is the directory containing ImageJ.app?<br>
><br>
> Best regards,<br>
><br>
> -wayne<br>
><br>
><br>
> > On Jun 17, 2015, at 10:34 PM, Curtis Rueden <<a href="mailto:ctrueden@WISC.EDU" target="_blank">ctrueden@WISC.EDU</a>> wrote:<br>
> ><br>
> > Hi Wayne,<br>
> ><br>
> > It looks like the Maven command failed to build the project. The directory listing is only the source code from Git.<br>
> ><br>
> > The error indicates something went wrong downloading artifacts for the Maven build system. The first time you run Maven it downloads many things, but they all get cached into ~/.m2/repository, so subsequent builds are much more reasonable. It looks like you had a connectivity-related error, which can probably be resolved simply by running "mvn" again, or perhaps "mvn -U" to force an update.<br>
> ><br>
> > If running "mvn" and/or 'mvn -U" a couple more times does not resolve the issue, let me know.<br>
> ><br>
> > Regards,<br>
> > Curtis<br>
> ><br>
> > On Wed, Jun 17, 2015 at 7:18 PM, Rasband, Wayne (NIH/NIMH) [E] <<a href="mailto:rasbandw@mail.nih.gov" target="_blank">rasbandw@mail.nih.gov</a>> wrote:<br>
> > Hi Curtis,<br>
> ><br>
> > I was able to install maven after doing "brew update”. I followed your instructions for building platform bundles for ImageJ 1.x, and it appeared to work except for this error:<br>
> ><br>
> > [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (enforce-rules) on project ij: Execution enforce-rules of goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce failed: Plugin org.apache.maven.plugins:maven-enforcer-plugin:1.3.1 or one of its dependencies could not be resolved: Could not transfer artifact org.eclipse.aether:aether-util:jar:0.9.0.M2 from/to central (<a href="https://repo.maven.apache.org/maven2" rel="noreferrer" target="_blank">https://repo.maven.apache.org/maven2</a>): Connect to <a href="http://repo.maven.apache.org:443" rel="noreferrer" target="_blank">repo.maven.apache.org:443</a> [<a href="http://repo.maven.apache.org/199.27.76.215" rel="noreferrer" target="_blank">repo.maven.apache.org/199.27.76.215</a>] failed: Operation timed out -> [Help 1]<br>
> ><br>
> > It generated an ImageJA folder but there is no target folder in it. This is what the ImageJA directory looks like:<br>
> ><br>
> > ImageJA<br>
> >    applet.html<br>
> >    aREADME.txt<br>
> >    build.xml<br>
> >    pom.xml<br>
> >    release-notes.html<br>
> >    src/<br>
> >       main/<br>
> >          deploy/<br>
> >             package/<br>
> >                macosx/<br>
> >                   ImageJ-volume.icns<br>
> >                   ImageJ.icns<br>
> >                windows/<br>
> >                   ImageJ.ico<br>
> >          java/<br>
> >             ij/<br>
> >                CommandListener.java<br>
> >                CompositeImage.java<br>
> >                …<br>
> ><br>
> > Thanks for your help,<br>
> ><br>
> > -wayne<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > > On Jun 17, 2015, at 3:33 PM, Curtis Rueden <<a href="mailto:ctrueden@WISC.EDU" target="_blank">ctrueden@WISC.EDU</a>> wrote:<br>
> > ><br>
> > > Hi Wayne,<br>
> > ><br>
> > > It may be that the Maven download is choosing a mirror with wrong SHA1. Or it may be that your download is truly incomplete.<br>
> > ><br>
> > > Did you try to rm the file out of /Library/Caches/Homebrew and do it again?<br>
> > ><br>
> > > Did you try "brew update" first?<br>
> > ><br>
> > > <a href="http://stackoverflow.com/q/12757694/1207769" rel="noreferrer" target="_blank">http://stackoverflow.com/q/12757694/1207769</a><br>
> > > <a href="http://apple.stackexchange.com/q/57172" rel="noreferrer" target="_blank">http://apple.stackexchange.com/q/57172</a><br>
> > ><br>
> > > Regards,<br>
> > > Curtis<br>
> > ><br>
> > > On Wed, Jun 17, 2015 at 1:51 PM, Rasband, Wayne (NIH/NIMH) [E] <<a href="mailto:rasbandw@mail.nih.gov" target="_blank">rasbandw@mail.nih.gov</a>> wrote:<br>
> > > Hi Curtis,<br>
> > ><br>
> > > I am still not having much luck. This is what I get when I try to use "brew install maven” to install maven:<br>
> > ><br>
> > > bash-3.2$ brew install maven<br>
> > > ==> Downloading <a href="http://www.apache.org/dyn/closer.cgi?path=maven/maven-3/3.2.3/binaries/apache-maven-3.2.3-bin.tar.gz" rel="noreferrer" target="_blank">http://www.apache.org/dyn/closer.cgi?path=maven/maven-3/3.2.3/binaries/apache-maven-3.2.3-bin.tar.gz</a><br>
> > > ==> Best Mirror <a href="http://apache.mesi.com.ar/maven/maven-3/3.2.3/binaries/apache-maven-3.2.3-bin.tar.gz" rel="noreferrer" target="_blank">http://apache.mesi.com.ar/maven/maven-3/3.2.3/binaries/apache-maven-3.2.3-bin.tar.gz</a><br>
> > > ######################################################################## 100.0%<br>
> > > Error: SHA1 mismatch<br>
> > > Expected: 1ce6641f7dcb4fd5785bedcdca2979da83f6d23f<br>
> > > Actual: 2e7c28f3ebc08b95934336680365cfaac2697155<br>
> > > Archive: /Library/Caches/Homebrew/maven-3.2.3.tar.gz<br>
> > > To retry an incomplete download, remove the file above.<br>
> > ><br>
> > > Best regards,<br>
> > ><br>
> > > -wayne<br>
> > ><br>
> > > > On Jun 17, 2015, at 12:09 PM, Curtis Rueden <<a href="mailto:ctrueden@WISC.EDU" target="_blank">ctrueden@WISC.EDU</a>> wrote:<br>
> > > ><br>
> > > > Hi Wayne,<br>
> > > ><br>
> > > > I just pushed some commits to the ImageJA repository [1] so that it can also build the same platform-specific application bundles -- but for vanilla ImageJ1 alone.<br>
> > > ><br>
> > > > To install Maven on your OS X machine, I recommend using Homebrew [2]. Then you can simply do:<br>
> > > ><br>
> > > >     brew install maven<br>
> > > ><br>
> > > > And you'll have a working mvn command.<br>
> > > ><br>
> > > > Note that the application bundling feature requires Java 8, since it is JavaFX-related functionality.<br>
> > > ><br>
> > > > So the commands you need to build platform bundles for ImageJ 1.x are:<br>
> > > ><br>
> > > >     git clone git://<a href="http://github.com/imagej/ImageJA" rel="noreferrer" target="_blank">github.com/imagej/ImageJA</a><br>
> > > >     cd ImageJA<br>
> > > >     mvn -Pdist<br>
> > > ><br>
> > > > And it should create them in the target/jfx/native folder. There should be .dmg and a .pkg installers, which including a Java 8 runtime embedded (in the ImageJ.app/Contents/PlugIns/Java.runtime folder internally). There should also be an ImageJ.app in there. There is also a double-clickable ImageJ.jar in the target/jfx/app folder (with empty lib/ folder since ImageJ 1.x has no dependencies), as well another set of installers that do _not_ include the JRE in the target/jfx/native-nojre folder.<br>
> > > ><br>
> > > > Happy to help troubleshoot if you continue to have problems getting this working.<br>
> > > ><br>
> > > > Regards,<br>
> > > > Curtis<br>
> > > ><br>
> > > > P.S. You may notice one exception when building the ImageJA bundles, relating to the version string not conforming to "x.y.z" pattern, but it does not halt the build.<br>
> > > ><br>
> > > > [1] <a href="https://github.com/imagej/ImageJA" rel="noreferrer" target="_blank">https://github.com/imagej/ImageJA</a><br>
> > > > [2] <a href="http://brew.sh" rel="noreferrer" target="_blank">http://brew.sh</a><br>
> > > ><br>
> > > > On Wed, Jun 17, 2015 at 9:59 AM, Rasband, Wayne (NIH/NIMH) [E] <<a href="mailto:rasbandw@mail.nih.gov" target="_blank">rasbandw@mail.nih.gov</a>> wrote:<br>
> > > ><br>
> > > > > On Jun 16, 2015, at 6:09 PM, Curtis Rueden <<a href="mailto:ctrueden@WISC.EDU" target="_blank">ctrueden@WISC.EDU</a>> wrote:<br>
> > > > ><br>
> > > > > Hi everyone,<br>
> > > > ><br>
> > > > > For those curious about the new JavaFX packaging for ImageJ, the relevant bits are now merged to master. So you can play with it if you like:<br>
> > > > ><br>
> > > > >   git clone git://<a href="http://github.com/imagej/imagej" rel="noreferrer" target="_blank">github.com/imagej/imagej</a><br>
> > > > >   mvn -Pdist<br>
> > > > ><br>
> > > > > And you should get some platform-specific application bundles in target/jfx/app and target/jfx/native directories.<br>
> > > > ><br>
> > > > > Of course, the ImageJ Updater is still ignorant of the new directory structure (with core ImageJ stuff in the lib/ folder instead of jars/). And since the native launcher is no longer the ImageJ Launcher, many CLI flags do not work at the moment. But we will keep working on it!<br>
> > > ><br>
> > > > Hi Curtis,<br>
> > > ><br>
> > > > Is there an OS X application bundle that includes Java 8 available for download? I have not had any luck getting the the ‘mvn' command to work.<br>
> > > ><br>
> > > > -wayne<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > _______________________________________________<br>
> > > > ImageJ-devel mailing list<br>
> > > > <a href="mailto:ImageJ-devel@imagej.net" target="_blank">ImageJ-devel@imagej.net</a><br>
> > > > <a href="http://imagej.net/mailman/listinfo/imagej-devel" rel="noreferrer" target="_blank">http://imagej.net/mailman/listinfo/imagej-devel</a><br>
> > > ><br>
> > ><br>
> > ><br>
> ><br>
> ><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div></div>