简体   繁体   English

如何使用自定义 Java 库(来自 github)

[英]How can I use custom java library (from github)

I want to use a custom library from github我想使用来自 github 的自定义库
( https://github.com/ddoleye/java-hwp ) ( https://github.com/ddoleye/java-hwp )

How can I import it and use it?如何导入并使用它?
I want to import and use the library in file_read.java file我想导入和使用 file_read.java 文件中的库我的系统

Normally, that library would have been published on maven central , but that doesn't seem to be the case here.通常,该库会在 maven central 上发布,但这里似乎并非如此。

Instead, the GitHub repo includes directly the generated compiled classes (which is not the best practice)相反,GitHub 存储库直接包含生成的编译类(这不是最佳实践)

That means you can clone that repo anywhere you want, and add a library to your project, with the classes and sources referencing the folder you have used to clone the repo.这意味着您可以在任何地方克隆该存储并将库添加到您的项目中,类和源引用您用于克隆存储的文件夹。

On my end is use InteliiJ IDE and the process is quite easy when cloning a repository from Git hub我的最后是使用InteliiJ IDE ,从 Git 中心克隆存储库时该过程非常简单

  • main menu, select VCS |主菜单,选择VCS | Get from Version Control , or, if no project is currently opened, click Get from Version Control on the Welcome screen .从版本控制中获取,或者,如果当前没有打开任何项目,请单击欢迎屏幕上的从版本控制中获取

  • In the Get from Version Control dialog, specify the URL of the从版本控制获取对话框中,指定
    remote repository you want to clone, or select one of the VCS hosting services on the left.要克隆的远程存储库,或选择左侧的 VCS 托管服务之一。

  • If you are already logged in to the selected hosting service,如果您已经登录到所选的托管服务,
    completion will suggest the list of available repositories that you完成将建议您的可用存储库列表
    can clone.可以克隆。

在此处输入图片说明

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

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