简体   繁体   English

jar文件中的运送库

[英]Shipping library in the jar file

When I add a library to my project bin directory and it is shipped in the jar file. 当我将库添加到我的项目bin目录中时,它在jar文件中提供。

Is it now statically linked or dynamically linked with the code? 现在是与代码静态链接还是动态链接?

Thanks 谢谢

Are you talking about a DLL / shared object / native binary here? 您在这里谈论的是DLL /共享对象/本机二进制文件吗? There is no such thing as static or dynamic linking in Java world. Java世界中没有静态或动态链接。 There are only jars which you put on the classpath. 只有放在类路径上的jar。 Any natives should be in the OS specific native search path. 任何本机都应在特定于操作系统的本机搜索路径中。 There is no standard for a 'bin' directory, but an IDE might facilitate something like that. “ bin”目录没有标准,但是IDE可能会促进类似的事情。 You'd have to check the manual of the IDE you're using. 您必须检查所用IDE的手册。

I tend to put any natives used in the directory where the java command is invoked. 我倾向于将所有使用的本机放在调用Java命令的目录中。 Since I always build executable jars, the natives go in the same directory as the jar. 由于我总是构建可执行的jar,因此本机与jar放在同一目录中。 Nice and stupid, no configuration needed. 漂亮又愚蠢,不需要任何配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM