同一个包的类可以分布在多个Jar文件中吗? [英] Can classes of same package spread across multiple Jar files?

查看:163
本文介绍了同一个包的类可以分布在多个Jar文件中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JAR文件中的一些类,它们属于一个包(com.abc.xyz)。

I am using some classes from a JAR file and they belong to a package (com.abc.xyz).

我写的类也属于该包但我无法将我的文件捆绑到该JAR文件中。是否可以将属于同一个包的类分布在多个JAR文件中?

The class am writing also belongs to that package but I won't be able to bundle my file into that JAR file. Is it possible to have classes that belong to the same package spread across multiple JAR files?

推荐答案

默认情况下,绝对是。

但是,如果您想要以确保来自特定包的类仅从 加载一个jar文件,那么可以将该信息添加到清单

However, if you want to make sure that classes from a particular package are only loaded from one jar file, you can add that information to the manifest.

这篇关于同一个包的类可以分布在多个Jar文件中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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