Closed jpsacha closed 8 years ago
No one on the LOCI ImageJ team has ever tried building on Windows 10. If you get it working, feel free to contribute some instructions on how to do so, via a pull request.
For anyone else finding this issue: @jpsacha also posted this question on the ImageJ forum.
I don't have access to the computer I did this on until later today. When I am able to retrace my steps, I'll post a short guide here and cross-post in the forum.
@jpsacha Could you check if that works for you (on 64-bit I assume), please?
@stelfrich Thank you very much for taking the time to write this up!
@ctrueden Should I open a PR for the fix-win10-sleep
branch? We could keep that PR open until the LOCI VM is up again..
It's true that that sleep
logic was added a very long time ago. But are you sure it is safe to delete?
@stelfrich Thanks for documenting the steps. It mostly worked. It may need a tweak to pom.xml for copying
.
I already had quite similar setup, I just modified fstab
as described.
Maven first reports something that look like an "error":
[ERROR] In file included from D:\src\imagej-launcher\src\main\include/config.h:34:0,
[ERROR] from D:\src\imagej-launcher\src\main\c\config.c:32:
[ERROR] In file included from C:\Apps\jdk1.8.0_92-x64/include/jni.h:45:0,
[WARNING] D:\src\imagej-launcher\src\main\include/string-funcs.h:67:19: warning: inline function 'is_digit' declared but never defined
[ERROR] D:\src\imagej-launcher\src\main\c\file-funcs.c: In function 'find_jar':
[ERROR] from D:\src\imagej-launcher\src\main\c\ImageJ.c:68:
[ERROR] In file included from D:\src\imagej-launcher\src\main\include/file-funcs.h:34:0,
[ERROR] D:\src\imagej-launcher\src\main\c\platform.c: In function 'get_memory_size':
[ERROR] D:\src\imagej-launcher\src\main\c\splash.c: In function 'show_splash':
[WARNING] D:\src\imagej-launcher\src\main\c\file-funcs.c:379:7: warning: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration]
[ERROR] In file included from D:\src\imagej-launcher\src\main\include/file-funcs.h:34:0,
[ERROR] extern inline int is_digit(char c);
[ERROR] ^
[ERROR] from D:\src\imagej-launcher\src\main\c\java.c:33:
[ERROR] !isdigit(name[prefix_length + 1]) ||
Though on closer look, it is not clear of this is really an actual error from a compiler or "label" added by Maven. The compilation actually completes. Binaries are created, but Maven build fails later with a message:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (copy) on project imagej-launcher: An Ant BuildException has occured: Cannot perform operation from directory to file.
[ERROR] around Ant part ...<copy tofile="D:\src\imagej-launcher_fix-win10-sleep.git\target\ImageJ-win64.exe">... @ 4:128 in D:\src\imagej-launcher_fix-win10-sleep.git\target\antrun\build-main.xml
That is probably an issue the Ant task definition. I was running this with Maven 3.3.9.
I got what I needed, the binaries for the launcher :)
BTW: I was also able to build the binaries using CLion and the same mingw (v.4.9.3). Nice thing is that I can debug the launcher C code from CLion, though it is using CMake instead of Maven.
@jpsacha The NAR Maven plugin is not smart enough to distinguish between compiler errors and compiler warnings. So both such output gets prefixed with [ERROR]
. Fixing this would probably be doable but nontrivial, if you want to try. (https://github.com/maven-nar/nar-maven-plugin)
The Maven build is failed only when the compiler returns a non-zero error code.
I got what I needed, the binaries for the launcher :)
That's the only reason you wanted to build? Why not extract them from the Maven repository instead then? http://maven.imagej.net/#nexus-search;gav~net.imagej~imagej-launcher~~~
Unless you needed to modify the code...?
I was hoping to fix some issues. There are a couple of different things I was going after. I also launcher for ImageJ 1, so I may be touching its parts that are not frequently used. One, as reported is issue #42, with the way launcher converts paths. For instance, *
is not expanded correctly, slashes are mixed up, paths converted to DOS format. I was looking how this could be corrected. Though if that launcher is going away in favor native Java launcher, it may better to focus on new launcher.
Another thing was with high DPI displays (4K) that use scaling. Seems that the launcher worked better than ImageJ 1 launcher (Java 8). I was trying to figure out why. Turns out though that it only works till you try to create JavaFX thread, then UI suddenly shrinks. Not clear if this launcher or Java issue, though pure JavaFX applications work fine. Java 9 works better (with Swing), but many libraries do not yet correctly work with Java 9, like jai_imageio, FontAwsomeFX, etc (though I was able to patch a few, still need to post that code to GitHub/Bitbucket :).
@jpsacha Thanks for the info. I'm glad someone is exploring these things, since I personally have not had time.
If you want to play with the JavaFX launcher, you can generate it by cloning https://github.com/imagej/imagej and then running mvn -Pdist
and looking in the target/jfx
subtree. This is still highly experimental. But I'm really, really hoping we can discontinue the need for us to maintain that C code, since it is rife with (IMO) unmaintainable case logic.
See also imagej/imagej-launcher#33
I tried mvn -Pdist
. Files get generated. I tried running target\jfx\native-nojre\ImageJ\imagej.exe
. At some point I selected "Update...". That seems to ticke Symantec, it started complaining about SONAR.Downloader!gen2 infectiion and deleted several of the files including the generated imagej.exe
. Did you come across this?
After reboot and doing the same things. There were no issues with Symantec.
The instructions provided by @stelfrich work on Windows, so I am closing this issue.
The JavaFX launcher is better discussed at imagej/imagej-launcher#33.
Please provide prerequisites and instructions for building imagej-launcher on Windows 10.