在jar中更新类,指定目录? [英] Updating class in jar, specify directory?

查看:176
本文介绍了在jar中更新类,指定目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更新jar中的.class文件。 .class文件位于jar中的文件夹中。如果我想更新它,我是否需要指定它所在的特定路径名?

I want to update a .class file in a jar. The .class file is in a folder in the jar. If I want to update it, do I need to specify the specific pathname where it's located?

我该怎么做:

jar uf myJar.jar myFolder / myClass.class

Do I do:
jar uf myJar.jar myFolder/myClass.class

或只是:

jar uf myJar.jar myClass.class

or just:
jar uf myJar.jar myClass.class

如果我没有指定路径,它会自动找到.class并替换它吗?或者允许jar在不同目录中具有相同的.class名称?

If I don't specify path, will it automatically find the .class and replace it? Or are jars allowed to have the same .class names within different directories?

推荐答案

您需要明确。在不同的包中使用相同名称的不同类是完全有效的。例如

You need to be explicit. It's perfectly valid to have different classes with the same name in different packages. e.g.

com.example.package.A
com.example.package.subpackage.A

等......

这篇关于在jar中更新类,指定目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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