Bug 572294 - AutoRegisterSchemeHandlersJob can't find dependant libraries
Summary: AutoRegisterSchemeHandlersJob can't find dependant libraries
Status: CLOSED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Launcher (show other bugs)
Version: 4.19   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2021-03-25 08:49 EDT by Matej Petras CLA
Modified: 2023-09-28 14:01 EDT (History)
3 users (show)

See Also:


Attachments
eclipse-jna-dll-failure (57.38 KB, text/plain)
2021-10-05 08:06 EDT, Juraj Michálek CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matej Petras CLA 2021-03-25 08:49:24 EDT
PC Information:
Fresh windows installation with Java SE 15 (jdk-15.0.2) and manually downloaded Eclipse EE.

Frequency:
Occurs after each startup.

Error Detail (note that dots in path were added manually by me):
An internal error occurred during: "AutoRegisterSchemeHandlersJob".
C:\...\AppData\Local\Temp\jna--116087464\jna202524229484616977.dll: Can't find dependent libraries
Comment 1 Andrey Loskutov CLA 2021-03-26 09:36:31 EDT
Please attach full Eclipse error log.
Comment 2 Juraj Michálek CLA 2021-10-05 07:53:12 EDT
How to simulate:
- Switch Windows 10 or 11 to UTF-8 mode (codepage: 65001)
- Set user TMP environment variable to path with special character
- Remove previous workspace and ~/.eclipse, to avoid collision with previous state
- Start Eclipse, open workspace, error message will appear

Impact:
- majority of plugins does not work properly

Possible workarounds:
- Set TMP environment variable to path without special character
- Turn off Windows UTF-8 support
- detailed description of workarounds: https://georgik.rocks/eclipse-error-autoregisterschemehandlersjob-cant-find-dependent-libraries/

Expected behaviour:
- Eclipse starts without the crash

Affected users: Windows users with special character in user login. Typical case of accounts created via AzureAD. Windows automatically set TMP and TEMP variables to user's home which contains special character.
Comment 3 Juraj Michálek CLA 2021-10-05 08:06:41 EDT
Created attachment 287259 [details]
eclipse-jna-dll-failure

The error message is on line 47.
Rest of errors are result of malfunction of JNA in plugins.
This error is present even in freshly downloaded Eclipse without installed plugins.
Comment 4 Jonah Graham CLA 2021-10-05 12:31:40 EDT
AFAIU this is a JRE bug[1] that Eclipse is exposed to via JNA library[2].

The issue in the past was dismissed (and marked wont fix by Oracle)[1] because it was put down to mismatched System locale and User locale. My guess is this new UTF-8 option reexposes the issue in a new way.

For a user that is experiencing this problem, does Eclipse SWT work if Eclipse itself is in the home directory somewhere?

I am not sure what can be done about this, except perhaps to detect the problematic use case so that the error message can be more helpful. On machines without Administrator access it can be that the only directory the Eclipse user has write access to is the home directory.

[1] https://bugs.openjdk.java.net/browse/JDK-8017274
[2] https://github.com/java-native-access/jna/issues/238
Comment 5 Juraj Michálek CLA 2021-10-06 07:15:23 EDT
Thank you for pointer to JRE problem.

Just made another test and moved whole Eclipse to C:\a. This work.
Then I moved it to C:\á. It fails with:
Failed to find a Main Class in "C:\á
\\plugins\org.eclipse.equinox.launcher_1.6.200.v20210416-2027.jar".

Content of eclipse.ini
-startup
plugins/org.eclipse.equinox.launcher_1.6.200.v20210416-2027.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.200.v20210429-1609
-product
org.eclipse.epp.package.cpp.product
-showsplash
org.eclipse.epp.package.common
--launcher.defaultAction
openFile
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_16.0.1.v20210528-1205/jre/bin
-vmargs
-Dosgi.requiredJavaVersion=11
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-Dsun.java.command=Eclipse
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM
Comment 6 Jonah Graham CLA 2021-10-06 10:11:48 EDT
I would be tempted to close this a NOT_ECLIPSE - but because I think it is likely to happen more often in the future perhaps the Launcher can detect such cases and at least provide a more useful error message. There are of course users who won't be able to avoid such encoded names, but hopefully they can show this bug to their IT department to get permission to have a directory that has same user and system encoding.

I am moving this bug to Launcher - but I am open to any other suggestions on how to resolve this.
Comment 7 Juraj Michálek CLA 2021-10-07 00:23:29 EDT
Thank you for keeping this bug open. Basically there are two bugs on Windows related to special characters:
- eclipse.exe launcher is on path with special character - Eclipse won't start
- user's TMP path has special characters - Eclipse starts with error message, but majority of plugins won't work
Comment 8 Juraj Michálek CLA 2021-10-07 06:34:40 EDT
Just let me add some additional information.

Both problems are present only when UTF-8 support is turned on.
You can turn it on in Regional Settings - Language for non-Unicode programs.
The Windows will change active code page to: 65001
You can verify code page by command: chcp.com
Comment 9 Eclipse Genie CLA 2023-09-28 14:01:31 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.