bytedeco / javacpp

The missing bridge between Java and native C++
Other
4.48k stars 581 forks source link

javacpp resource loading exception in springboot application #683

Closed huazai023 closed 1 year ago

huazai023 commented 1 year ago

Error: When the springboot application depends on javacpp, the javacpp loader cannot extract the required files

Reason: When javacpp is integrated into the springboot application, the path for the loader class to obtain resources becomes jar:file:/aa.jar!/BOOT-INF/lib/bb.jar!/com/bb/test.txt This path will cause resource loading exceptions in the Loader class

Solution: Change line 809 in the loader class from URL u = new URL(s.substring(0, s.indexOf("!/") + 2) + entryName); to: URL u = new URL(s.substring (0, s. lastIndexOf("!/") + 2) + entryName);

saudet commented 1 year ago

Sounds good, please open a pull request with this change! Thanks

huazai023 commented 1 year ago

I've opened a pull request, link: https://github.com/bytedeco/javacpp/pull/685

huazai023 commented 1 year ago

Hello: Can you provide cpython's Android platform compilation script?

saudet commented 1 year ago

Ah, I see, that's what you were asking about in https://github.com/bytedeco/javacpp-presets/issues/1363. I've reopened it

saudet commented 1 year ago

Fix released with JavaCPP 1.5.9! Thanks for the contribution