简体   繁体   中英

Shipping library in the jar file

When I add a library to my project bin directory and it is shipped in the jar file.

Is it now statically linked or dynamically linked with the code?

Thanks

Are you talking about a DLL / shared object / native binary here? There is no such thing as static or dynamic linking in Java world. There are only jars which you put on the classpath. 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. You'd have to check the manual of the IDE you're using.

I tend to put any natives used in the directory where the java command is invoked. Since I always build executable jars, the natives go in the same directory as the jar. Nice and stupid, no configuration needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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