简体   繁体   English

将自定义库导出到可导入的 jar 文件 java

[英]Export custom library to importable jar file java

I have created a custom package in Java.我在 Java 中创建了一个自定义 package。 The directory structure is like this:-目录结构是这样的:-

wolpha沃尔法

   /Stream>Stream.java

   /Word/Stream.java

   /Pattern/Stream.java

   /Stream/Stream.java

So I just made a non runnable jar file and tried to import the package but it gave a error that the package wolpha does not exist.所以我刚刚制作了一个不可运行的 jar 文件并尝试导入 package 但它给出了 package wolpha 不存在的错误。 Tried with a main class with imports included but gave the same error.尝试使用包含导入的主要 class 但给出了相同的错误。

How can I add all these classes into a single.jar file such that all classes can be imported into any file.如何将所有这些类添加到单个.jar 文件中,以便可以将所有类导入到任何文件中。 I expect some step-by-step instructions with some down-to-earth language.我期待一些带有一些脚踏实地的语言的分步说明。

If you are using eclipse, go to File > Export and follow the instructions as per the screenshots given below:如果您使用 eclipse、go 到文件 > 导出并按照以下屏幕截图中的说明进行操作:

在此处输入图像描述

在此处输入图像描述

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

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