kwhat / jnativehook

Global keyboard and mouse listeners for Java.
Other
1.75k stars 348 forks source link

Does not run on jre 1.8 #389

Closed MichaelEnke closed 2 years ago

MichaelEnke commented 2 years ago

In DefaultLibraryLocator the method URLDecoder.decode(String, Charset) is used which is not available in 1.8. Instead please use URLDecoder.decode(String, String) (with catching UnsupportedEncodingException). Thank you.

kwhat commented 2 years ago

Can you give me a line number, I'm not seeing it in https://github.com/kwhat/jnativehook/blob/2.2/src/main/java/com/github/kwhat/jnativehook/DefaultLibraryLocator.java

MichaelEnke commented 2 years ago

Oh, that report has wrong subject, sorry. Was about a change I did locally. The problem is with Windows and space(s) in the path: classLocation.toURI() returns file:/C:/Program%20Files/... classLocation.getPath() returns /C:/Program%20Files/... To fix it, please add a URLDecoder.decode(String, String) (and not URLDecoder.decode(String, Charset).

kwhat commented 2 years ago

That should have been fixed in 2.2.1, is it still a problem?

MichaelEnke commented 2 years ago

Oh yes, sorry, I was on 2.2 branch ...