Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fileAssociations and filename contains non latin characters #209

Open
jsyzthz opened this issue Jun 16, 2016 · 28 comments
Open

fileAssociations and filename contains non latin characters #209

jsyzthz opened this issue Jun 16, 2016 · 28 comments

Comments

@jsyzthz
Copy link

jsyzthz commented Jun 16, 2016

Hi,
i have link all "*.test" files to my exe using 'fileAssociations'.
but if i create a file named as "中国.test"(with chinese charcter).if i double click this file will get error(empty content,no details),continue to click ok i will get another error dialog "Failed to launch JVM".
i have set -Dfile.encoding=UTF-8.
any idea to fix this?
thanks!

@FibreFoX FibreFoX self-assigned this Jun 16, 2016
@FibreFoX
Copy link
Member

Hi @jsyzthz ,
first of all: thanks for using this little maven-plugin 😸

Could you please provide a simple project, where this issue can be recreated? What JDK did you use to create you bundle? And how did you set -Dfile.encoding=UTF-8?

Mostly there is some bug when using older maven-plugin-versions or having a buggy JDK, even misconfiguration is possible, but to determine, what is going wrong, I need to recreate that behaviour.

@jsyzthz
Copy link
Author

jsyzthz commented Jun 17, 2016

sorry, i have push my code to https://github.com/jsyzthz/javafx
my env:
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)
thank very much!

@FibreFoX
Copy link
Member

Hi @jsyzthz , I'm on it, will come back with some results ;)

@FibreFoX
Copy link
Member

I can reproduce this behaviour using the generated native launcher, this fails on non-latin chars. When launching the containing app (inside the app-folder) with java -jar test-jfx.jar c:\(somepath)\中国.test DOES work, this this is clearly a BUG inside the native launcher, and not a bug of this maven-plugin.

@FibreFoX
Copy link
Member

Only thing that I found is this here: https://bugs.openjdk.java.net/browse/JDK-8029584

I might dig into this a bit more, but feel free to open some bug on the Oracle-JDK yourself.

@jsyzthz
Copy link
Author

jsyzthz commented Jun 17, 2016

thanks,i will keep to debug , java -jar ... is ok.

@FibreFoX
Copy link
Member

I bet it has something to do with char-encoding inside the native launcher, which resides inside some nasty C/CPP-program

@jsyzthz
Copy link
Author

jsyzthz commented Jun 20, 2016

i test inno setup sample project. pass parameter with chinese character is ok.
so issue between exe and jvm? i think.

@FibreFoX
Copy link
Member

That exe-file is called "native launcher" :) and yes, I think too that the issue lies between the EXE-file and the JVM, but haven't located that issue yet. All argument copy-parts are using unicode-methods, maybe I missed some (as my c/cpp-skill is a bit rusty and old, hehe).

@FibreFoX
Copy link
Member

Hi @jsyzthz, did you try it with the native launcher on linux or macosx? There is some thing crossing my mind:

  • if it is the native launcher, which part is it? maybe the packager.dll (which is the real bridge to the JVM) has this flaw, and if so, this might be reproducable on other systems than windows. If that is NOT reproducable, this bug is windows-only
  • some bug inside the JDK, yet unrecognized?

@jsyzthz
Copy link
Author

jsyzthz commented Jun 21, 2016

Hi @FibreFoX , i install centos linux(7.2.15511) in virtualbox. I build a rpm installer under centos,then install it and test ok.
sorry i don't know how to install a mac system under virtualbox.


i found another issue about javafx packager when building the rpm packager.
i update my porject version to "1.0.0-RC1" and update nativeReleaseVersion to "${project.version}"
build failed with error "error: line 3: Illegal char '-' in : Version:1.0.0-RC1". windows no such error.

@FibreFoX
Copy link
Member

That version-thing is no issue, this is an already communicated restriction! the nativeReleaseVersion-property is only allowed to have "traditional" versioning, means no chars, only numbers and maximum 2 dots (like SEMVER), because (as you already found out) this is limited with some native bundlers.

When there is some free time, I might try to create some different native launcher. As this is no issue with the javafx-maven-plugin, can you please create some bug on oracle?

@jsyzthz
Copy link
Author

jsyzthz commented Jun 21, 2016

Sure, Review ID: JI-9040536
Thanks you help!

@jsyzthz
Copy link
Author

jsyzthz commented Jun 22, 2016

Update
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8160046
checked this for version 8u91 with NetBeans and couldn't reproduce the issue as reported.
The file with the file name having Chinese characters opened correctly without any error (see attached screenshot)
why can't reproduce?

@FibreFoX
Copy link
Member

Hm, I think they didn't try the native launcher on windows, mentioning something with "Netbeans" looks like they called the generated JAR-file instead of the native launcher (just guessing).

@FibreFoX
Copy link
Member

I will try to recreate the issue using the latest version of the JDK, will report back with insights.

@FibreFoX
Copy link
Member

Even with 1.8.0u92 this issue exists, will make some pull-requests to your test-project to make the scenario more clear ;)

@FibreFoX
Copy link
Member

@jsyzthz please accept the pull-request I made on your project ;) that might help to reproduce your issue.

@jsyzthz
Copy link
Author

jsyzthz commented Jun 22, 2016

@FibreFoX merged. thanks!

@FibreFoX
Copy link
Member

@jsyzthz did you inform oracle about the instruction-changes? any update on this?

@jsyzthz
Copy link
Author

jsyzthz commented Jun 23, 2016

which instruction? my test project? if yes,how to tell oracle,i just can only view the bug i reported.

@FibreFoX
Copy link
Member

@jsyzthz yes, I ment the test-project, which now has better description about how to reproduce.

I personally haven't been able to change existing bug.entries, so I'm afraid of being no help here. Maybe it would be the best to re-post that bug with the new instructions maybe? I will hold this issue on the javafx-maven-plugin open for others to see the progress, even this is nothing about the plugin itself.

@jsyzthz
Copy link
Author

jsyzthz commented Jun 27, 2016

Hi ,
I received an email from oracle:
https://bugs.openjdk.java.net/browse/JDK-8160046
I couldn’t reproduce this using IDE.
Followed steps as indicated in https://github.com/jsyzthz/javafx
However, subsequent to your current report, I could reproduce this with all versions including 8u60, 8u77, 8u91. Therefore, according to current analysis:

  • Issue is not reproducible when run from IDE
  • Issue is reproducible with 8u60, 8u77, 8u91
  • Regression is not confirmed
  • Received Exception in Application start method when run with 9 ea b124

@FibreFoX
Copy link
Member

FibreFoX commented Jun 27, 2016

Inside the IDE, the native generated file is never launched, thats the reason this issue can't be found inside the IDE ;)

As the reported bug didn't say something about IDE, I'm a bit confused why they didn't read the instructions before, but for that I commited a bit more detailed instructionset with the last PR 😄

This bug lies inside the native windows launcher, in the bridge between the JVM, I suspect the packager.dll, which is the real bridge.

Thanks for the update 👍

@FibreFoX
Copy link
Member

FibreFoX commented Jul 8, 2016

@jsyzthz any update on this? did you reopen/create a new issue about this?

@jsyzthz
Copy link
Author

jsyzthz commented Jul 11, 2016

Yes,i create a new defect for this,pls track it from here:
https://bugs.openjdk.java.net/browse/JDK-8160344
Thanks.

@FibreFoX FibreFoX removed their assignment Sep 2, 2016
@FibreFoX
Copy link
Member

FibreFoX commented Jul 5, 2017

This will now be tracked here (as the JDK-8160344 is closed as duplicate):
JDK-8133034 launcher crashes if started with non english arguments

seems that there is a problem with unicode-parts inside <appName> too:
JDK-8138642 Generated bundle is not executable when main class contains unicode

Will updates this when something changes.

Moneyquote from Danno:

This has never worked. This is a new manifestation of the general problem that the packager handles unicode poorly.

@FibreFoX
Copy link
Member

Note to myself: add whitelist-checks for appName to warn before non-latin filenames are used and developers are starting to search for non-existing bugs inside this plugin (it's the JDK anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants