简体   繁体   English

如何在Intellij中使用已编译的类

[英]How to use a compiled class in Intellij

I am wondering how to use an existing .class file in my Java Intellij project. 我想知道如何在Java Intellij项目中使用现有的.class文件。 How do you include an existing class in a project? 您如何在项目中包括现有课程? I don't have the .java file, just the .class file. 我没有.java文件,只有.class文件。 IntelliJ lets me paste in the package containing the .class file, but acts as if there is nothing in the package. IntelliJ让我粘贴到包含.class文件的软件包中,但是好像软件包中什么都没有。

I've used existing classes in my projects before by compiling from the command line, but I would like to know how to do it in Intellij. 在通过命令行进行编译之前,我已经在项目中使用了现有的类,但是我想知道如何在Intellij中进行操作。

您可以将此.class文件包含在类路径中,也可以将其添加到项目的依赖项中。

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

相关问题 如何从python中使用已编译的Java类? - How to use a compiled java class from within python? 从已编译的类文件中设置一个新项目intellij IDEA - Setting up a new project, intellij IDEA from compiled class files IntelliJ IDEA:如何使从源文件(.java)编译的Java字节码文件(.class)与源文件位于同一目录中? - IntelliJ IDEA: how to make the java bytecode files (.class) compiled from the source files (.java) be in the same directory as the source files? IntelliJ:如何使用不在我的项目文件夹中的主类 - IntelliJ: How to use a main class which is not inside my Project Folder Intellij,如何在我自己的项目中使用 .class(不含源代码) - Intellij, how to use a .class(without source code) in my own project 如何在IntelliJ插件框架中使用ConfigurableUI类? - How do I use the ConfigurableUI class in the IntelliJ plugin framework? 使用 IntelliJ 生成类图 - Use IntelliJ to generate class diagram IDEA JetBrains IntelliJ - 'make' 上的编译错误,但使用 Maven 编译时很好,并且 IntelliJ 在类文件中没有报告错误 - IDEA JetBrains IntelliJ - Compile error on 'make' but fine when compiled using Maven and no errors reported by IntelliJ in the class file 我可以在Maven插件中使用编译的类吗? - Can I use compiled class in Maven Plugin? 如何在Intellij中使用ROME? - How to use ROME in Intellij?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM