imagej / imagej-launcher

The ImageJ native launcher
https://imagej.net/learn/launcher
BSD 2-Clause "Simplified" License
21 stars 23 forks source link

Set -Dpython.console.encoding=UTF-8 by default #57

Closed stelfrich closed 5 years ago

stelfrich commented 5 years ago

Fixes #56.

stelfrich commented 5 years ago

@imagejan Do you have a Windows 7 machine that you could build/test this PR on? I only have a 32bit Windows 10 that I could use to compile the launcher, but not a Windows 7 one to properly test it...

imagejan commented 5 years ago

I wanted to take the opportunity to set up a running gcc on my Windows system, but when running mvn, I get:

these Maven log messages ``` Starting Core 9 with 1 source files... [ERROR] In file included from E:\code\imagej\imagej-launcher\src\main\include/config.h:34, [ERROR] from c/config.c:32: [WARNING] E:\code\imagej\imagej-launcher\src\main\include/string-funcs.h:67:19: warning: inline function 'is_digit' declared but never defined [ERROR] extern inline int is_digit(char c); [ERROR] ^~~~~~~~ [ERROR] In file included from E:\code\imagej\imagej-launcher\src\main\include/platform.h:36, [ERROR] In file included from E:\code\imagej\imagej-launcher\src\main\include/file-funcs.h:34, [ERROR] c/ImageJ.c: In function 'adjust_java_home_if_necessary': [ERROR] from c/java.c:33: [ERROR] from c/platform.c:33: [WARNING] E:\code\imagej\imagej-launcher\src\main\include/string-funcs.h:67:19: warning: inline function 'is_digit' declared but never defined [WARNING] c/ImageJ.c:2313:20: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] [ERROR] extern inline int is_digit(char c); [WARNING] E:\code\imagej\imagej-launcher\src\main\include/string-funcs.h:67:19: warning: inline function 'is_digit' declared but never defined [ERROR] ^~~~~~~~ [ERROR] char* debugPath = get_library_path(); [ERROR] extern inline int is_digit(char c); [ERROR] ^~~~~~~~~~~~~~~~ [ERROR] ^~~~~~~~ [ERROR] In file included from E:\code\imagej\imagej-launcher\src\main\include/config.h:34, [ERROR] from c/ImageJ.c:71: [ERROR] c/ImageJ.c: At top level: [WARNING] E:\code\imagej\imagej-launcher\src\main\include/string-funcs.h:67:19: warning: inline function 'is_digit' declared but never defined [ERROR] extern inline int is_digit(char c); [ERROR] ^~~~~~~~ [ERROR] c/exe-ico.c: In function 'set_exe_icon': [ERROR] In file included from E:\code\imagej\imagej-launcher\src\main\include/file-funcs.h:34, [ERROR] In file included from c/file-funcs.c:33: [ERROR] from c/splash.c:33: [WARNING] c/exe-ico.c:141:7: warning: implicit declaration of function 'file_exists'; did you mean 'filelength'? [-Wimplicit-function-declaration] [WARNING] E:\code\imagej\imagej-launcher\src\main\include/string-funcs.h:67:19: warning: inline function 'is_digit' declared but never defined [ERROR] c/file-funcs.c: In function 'mkdir_recursively': [ERROR] extern inline int is_digit(char c); [ERROR] if (!file_exists(exe_path)) { [ERROR] ^~~~~~~~ [WARNING] E:\code\imagej\imagej-launcher\src\main\include/platform.h:114:15: warning: implicit declaration of function 'fake_posix_mkdir' [-Wimplicit-function-declaration] [ERROR] ^~~~~~~~~~~ [ERROR] #define mkdir fake_posix_mkdir [ERROR] filelength [ERROR] ^~~~~~~~~~~~~~~~ [ERROR] E:\code\imagej\imagej-launcher\src\main\include/platform.h:114:15: note: in definition of macro 'mkdir' [ERROR] #define mkdir fake_posix_mkdir [ERROR] ^~~~~~~~~~~~~~~~ [ERROR] c/file-funcs.c: In function 'find_newest': [WARNING] c/file-funcs.c:509:13: warning: implicit declaration of function 'file_is_newer' [-Wimplicit-function-declaration] [ERROR] else if (file_is_newer(path->buffer, result->buffer)) { [ERROR] ^~~~~~~~~~~~~ [ERROR] In file included from E:\code\imagej\imagej-launcher\src\main\include/file-funcs.h:34, [ERROR] from c/file-funcs.c:32: [ERROR] c/file-funcs.c: At top level: [WARNING] E:\code\imagej\imagej-launcher\src\main\include/string-funcs.h:67:19: warning: inline function 'is_digit' declared but never defined [ERROR] extern inline int is_digit(char c); [ERROR] ^~~~~~~~ [INFO] 10 files were compiled. ```


and in the target folder, I end up with imagej-launcher-5.0.1-SNAPSHOT-amd64-Windows-gcc-executable.nar which apparently isn't the right thing for my platform, is it?


@stelfrich if you can provide me with a compiled launcher executable, I'm happy to test it on a Windows 7 system.

ctrueden commented 5 years ago

Maybe the easiest thing would be to merge this, wait for the AppVeyor build and use that? And then revert if there is any regression noticed?

stelfrich commented 5 years ago

Maybe the easiest thing would be to merge this, wait for the AppVeyor build and use that? And then revert if there is any regression noticed?

Let's do this. Shouldn't break anything...

imagejan commented 5 years ago

I downloaded imagej-launcher-5.0.1-20180821.152133-36-win64.exe and put it into my existing Fiji installation on Windows 7.

This is what I noticed:

stelfrich commented 5 years ago

I downloaded imagej-launcher-5.0.1-20180821.152133-36-win64.exe and put it into my existing Fiji installation on Windows 7.

That version that you mention here, @imagejan, is one that does not have the PR included yet (according to its timestamp at least). Would you mind checking again with imagej-launcher-5.0.1-20180925.115628-44-win64.exe?

the new launcher doesn't seem to pick up my system Java: when trying to launch, it complains

Let's try (although it might not be possible because property handling might have issues when falling back to the system java executable for launching) to focus on the Python issue. If this persists, let's open another issue to investigate this.

imagejan commented 5 years ago

does not have the PR included yet (according to its timestamp at least)

sorry for that: I was getting the SNAPSHOT from maven.imagej.net, but didn't double-check the timestamp...

Would you mind checking again with imagej-launcher-5.0.1-20180925.115628-44-win64.exe?

Yup, with this one I don't get the error message any more. I tried with Java 10.0.1 (after that spurious jvm.dll error dialog mentioned above) and with the bundled Java 1.8.0_66, it's fine in both cases.

Thanks again, @stelfrich!

ctrueden commented 4 years ago

Did anyone try setting this flag on the Java side using System.setProperty instead of in the native code?