简体   繁体   English

如何在我的代码中使用另一个 java 项目?

[英]How do I use another java project in my code?

I am currently using the Eclipse IDE and want to import an external java project so that I can use it in something I am working on.我目前正在使用 Eclipse IDE 并想导入一个外部 java 项目,以便我可以在我正在处理的事情中使用它。 I downloaded the directory of icePDF, found here , and would like to use the java class file " SwingViewBuilder.java " that is found in the directory I linked at "/icepdf/branches/icepdf-6.2.5/icepdf/viewer/src/org/icepdf/ri/common".我下载了在 这里找到的 icePDF 目录,并想使用在我链接的目录中的 java 类文件“ SwingViewBuilder.java ”“/icepdf/branches/icepdf-6.2.5/icepdf/viewer/src /org/icepdf/ri/common”。 I have tried some basic things like importing the folder itself, but it did not work.我尝试了一些基本的东西,比如导入文件夹本身,但它没有用。

I would highly suggest using a dependency management tool like Maven or Gradle to download this dependency and any other dependencies you may have into your project for you.我强烈建议使用像 Maven 或 Gradle 这样的依赖管理工具来为你下载这个依赖和你可能拥有的任何其他依赖到你的项目中。

Here is the maven getting started guide: https://maven.apache.org/guides/getting-started/这是 maven 入门指南: https : //maven.apache.org/guides/getting-started/

And here is the maven dependency for you to add to your pom.xml file: https://mvnrepository.com/artifact/org.icepdf.os/icepdf-viewer/6.2.2这是您添加到 pom.xml 文件的 maven 依赖项: https : //mvnrepository.com/artifact/org.icepdf.os/icepdf-viewer/6.2.2

If you specifically need version 6.2.5, you will need to build the icePDF project yourself and configure your class path to use it as a dependency.如果您特别需要 6.2.5 版本,则需要自己构建 icePDF 项目并配置您的类路径以将其用作依赖项。

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

相关问题 如何在另一个项目中使用Eclipse OSGi Java插件? - How do I use my Eclipse OSGi Java plug-in in another project? 如何在这个java项目中使用maven - How do I use maven with this java project 我需要在Java项目中使用什么相对路径 - What relative path do I need to use in my Java Project 没有GAE的我如何在自己的Java项目中使用GWT Google Web Toolkit? - How do I use GWT Google Web Toolkit in my own Java project without GAE? Eclipse Java远程调试:如何确保我在项目中获得的代码与JVM中运行的代码相同? - Eclipse Java Remote Debug: How do I ensure that the code I've got in my project is the same as the code running in the JVM? Java字节/源代码分析-如何以编程方式找到使用另一个类的所有类/方法? - Java byte/source code analysis - how do I find all the classes/methods that use another class - programmatically? 如何获取另一个Java项目的类路径? - How do I obtain classpath of another java project? 我如何在 IntelliJ IDEA 中使用来自另一个项目的类? - How do I use classes from another project in IntelliJ IDEA? 如何更改我的 Java 代码以使用 replset? 使用 Spring Data 和 MongoDB - How do I change my java code to use replset? with Spring Data and MongoDB 如何在Java代码中包含外部.class文件以使用它? - How do I include an external .class file to use it in my Java code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM