node-java icon indicating copy to clipboard operation
node-java copied to clipboard

Windows path issue with bundled resources

Open janpetzold opened this issue 8 years ago • 2 comments

I'm using node-java in an Electron app that the user may install to whatever directory. Now if that install directory contains special characters (German Umlauts ä, ö, ü) node-java does not get initialized and Electron app crashes.

I narrowed this down to the automatically loaded

/commons-lang3-node-java.jar
/src-java

which are automatically added to classpath in

lib/nodeJavaBridge.js

Moving these resources to some directory without special characters fixes the problem.

Interestingly my own JARs (in the same directory containing special characters) are added properly to classpath.

This is a very Windows-specific problem but any idea how to solve/bypass this would be very welcome. My only idea would be to move node-java dir to some general folder like C:\Users\Public and reference it from there.

I tried playing with codepage settings and Java command-line settings

-Dsun.jnu.encoding
-Dfile.encoding

but no effect.

Many thanks!

janpetzold avatar Jan 12 '18 16:01 janpetzold

I can confirm the issue with special characters

antoinepairet avatar Feb 01 '18 21:02 antoinepairet

any workaround?

sohobloo avatar Mar 11 '21 12:03 sohobloo