从jar导入java库类时,这被认为是静态链接吗?还是动态的? [英] When importing a java library class from jar, is this considered static linking? or dynamic?

查看:971
本文介绍了从jar导入java库类时,这被认为是静态链接吗?还是动态的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我的lib文件夹中有jcifs-1.3.14.jar,我有一个从库导入的类,并使用类似于

  import jcifs.smb。*; 
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(domain,
user,
pass);
SmbFile file = new SmbFile(path,auth);
//在这里执行一些操作

以这种方式使用库时它被认为是:A)静态链接或B)动态链接OR C)别的东西

解决方案

如果你正在寻找关于在Java程序上应用各种软件许可证的信息,然后在Google上搜索<许可证名称> Java 通常会产生有用的命中。



例如 LGPL Java 这是第一个命中。在这种特殊情况下,底线是:


链接到LGPL
库的应用程序不需要在$ b $下发布b LGPL。应用程序只需
按照LGPL的第6节
中的要求:允许
库的新版本与
应用程序链接;并允许反向
工程来调试这个。


只要图书馆在单独的JAR文件中提供,可以轻松替换,LGPL允许。



PS:我不是律师!如有疑问,请咨询。事实上,取决于你住在哪里,咨询一个人是有道理的,不管你有什么疑问。


say I have jcifs-1.3.14.jar in my lib folder, and I have a class that is importing from the library and uses the classes like:

import jcifs.smb.*;
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(domain, 
                                                                 user, 
                                                                 pass);
SmbFile file = new SmbFile(path, auth);
// do some operations with the file here

When using the library in this fashion is it considered to be: A) Static Linking OR B) Dynamic Linking OR C) something else?

解决方案

If you are looking for information about applying various software licenses on Java programs, then searching Google for <license name> Java usually results in a useful hit.

E.g for LGPL Java, this is the first hit. In this particular case, the bottom line is:

Applications which link to LGPL libraries need not be released under the LGPL. Applications need only follow the requirements in section 6 of the LGPL: allow new versions of the library to be linked with the application; and allow reverse engineering to debug this.

I.e. as long as the library is provided in a separate JAR file that can be easily replaced, LGPL allows it.

PS: I Am Not A Lawyer! If in doubt, consult one. As a matter of fact, depending on where you live, it might make sense to consult one regardless if you are in doubt or not.

这篇关于从jar导入java库类时,这被认为是静态链接吗?还是动态的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆