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

JIntellitype64.dll can't be found inside jar generated by Spring Boot #72

Closed
zhirea001 opened this issue Aug 4, 2022 · 6 comments · Fixed by #73
Closed

JIntellitype64.dll can't be found inside jar generated by Spring Boot #72

zhirea001 opened this issue Aug 4, 2022 · 6 comments · Fixed by #73
Assignees
Labels
Milestone

Comments

@zhirea001
Copy link

zhirea001 commented Aug 4, 2022

environment:
jdk:1.8
windows:win10
jintellitype:1.4.0

describe:
My development environment works normally,But when I make jar package,Put it on another computer to run,The above error occurred

error

@zhirea001
Copy link
Author

I tried to add jintellitype64.dll in appdata\local\jintellitype\1.4.0\ of the new computer,it works,But I don't know why this will take effect, and do I have to manually add DLL files to Disk C every time my jar package runs on another computer

@melloware
Copy link
Owner

I forget its been so long but I thought it was try and load it from inside the JAR first. @RocketMaDev any thoughts?

@RocketMaDev
Copy link
Collaborator

RocketMaDev commented Aug 5, 2022

en:

That's quite strange. It works properly on my system. Please show me the file structure in your jar file.

zh:

不应该啊,在我的系统上它工作得很正常。请放一个你打包好的jar的文件结构

@zhirea001
Copy link
Author

en:

That's quite strange. It works properly on my system. Please show me the file structure in your jar file.

zh:

不应该啊,在我的系统上它工作得很正常。请放一个你打包好的jar的文件结构
client-0.0.1-SNAPSHOT.zip
error1

EN:He reported an error at this position in the figure and could not find his windows internal files
ZH:我认为他是在图中那个位置Classloader获取文件时未找到文件,但是怎么解决我还没搞明白。现象就是我工程IDEA直接启动时classloader可以找到对应的dll文件,工程打成jar包后,classloader就找不到文件了

@RocketMaDev
Copy link
Collaborator

en:
Yep, you're right. I've checked your jar file and found the path of the library is actually BOOT-INF/classes/com.melloware.jintellitype/JIntellitype64.dll, different from the path defined in class, which can been seen in your exception stack. I have two options now:

  1. Download the source code and modify the jarPath to the actual path I mentioned and then compiled it.
  2. Use the reflection. Modify the method and then load it by yourself.

Considering my code level, a basic learner, you may consult search engine to look for other alternatives if you're not satisfied with the options above.

zh:
你说对了。我已经检查了你的文件结构,但是我发现dll文件位于BOOT-INF/classes/com.melloware.jintellitype/JIntellitype64.dll而不是你在错误堆栈里看到的它应该所在的位置。我现在有两个方案:
第一个就是下载这个项目的源码,然后把jarPath变量的前缀改一下,使其指向正确位置(即上文提到的真实位置),然后把它重新打包成jar
第二个就是用反射修改这个方法,然后手动加载一次

考虑到我还只是一个基础的Java学者,Spring架构还没接触过,所以说如果你对上面的两种方案都不满意的话,请自行搜索解决方案。

@RocketMaDev RocketMaDev self-assigned this Aug 6, 2022
@RocketMaDev RocketMaDev changed the title IOExcepition: FromJarToFileSystem could not load DLL: com/melloware/jintellitype/windows/JIntellitype64.dll JIntellitype64.dll can't be found inside jar generated by Spring Boot Aug 6, 2022
@zhirea001
Copy link
Author

en: Yep, you're right. I've checked your jar file and found the path of the library is actually BOOT-INF/classes/com.melloware.jintellitype/JIntellitype64.dll, different from the path defined in class, which can been seen in your exception stack. I have two options now:

  1. Download the source code and modify the jarPath to the actual path I mentioned and then compiled it.
  2. Use the reflection. Modify the method and then load it by yourself.

Considering my code level, a basic learner, you may consult search engine to look for other alternatives if you're not satisfied with the options above.

zh: 你说对了。我已经检查了你的文件结构,但是我发现dll文件位于BOOT-INF/classes/com.melloware.jintellitype/JIntellitype64.dll而不是你在错误堆栈里看到的它应该所在的位置。我现在有两个方案: 第一个就是下载这个项目的源码,然后把jarPath变量的前缀改一下,使其指向正确位置(即上文提到的真实位置),然后把它重新打包成jar 第二个就是用反射修改这个方法,然后手动加载一次

考虑到我还只是一个基础的Java学者,Spring架构还没接触过,所以说如果你对上面的两种方案都不满意的话,请自行搜索解决方案。

EN:Thanks. It's settled,I changed the way to read files in his source code
temp
ZH:我更改了他源码中读取文件的方式,更改后文件能够正常读取了,谢谢!

melloware pushed a commit that referenced this issue Aug 14, 2022
* Fix #72: update class loader to load the dll

* Optimize code to avoid warnings from IDEA
@melloware melloware added bug and removed question labels Aug 14, 2022
@melloware melloware added this to the 1.4.1 milestone Aug 14, 2022
@melloware melloware linked a pull request Aug 14, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants