且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Eclipse中的项目中包含.class文件? (Java)

更新时间:2023-01-10 14:41:52

您可以添加一个包含类文件的目录Eclipse项目,只要它在你的Eclipse项目之一,无论是在一个生成的目录中还是在你创建的一个。

You can add a directory containing the class files to the Eclipse project, only if it is inside one of your Eclipse projects, either in a generated directory or in one you have created.

这可以通过添加类文件夹到应用程序的Java构建路径。您可以在项目属性中设置,通过访问Java构建路径 - >库 - >添加类文件夹。请记住,你必须在包中指定包含类文件的根文件夹。

This can be done by adding the class folder to the Java build path of the application. You can set this in the Project properties, by visiting Java Build Path -> Libraries -> Add Class Folder. Keep in mind, that you will have to specify the root folder containing the class files in their packages.

因此,如果你希望编译器访问com.***。 Example.class出现在项目A下的类目录中(但不在项目A的构建路径中),那么应该将classes添加为类文件夹,而不是类/ com / ***作为类文件夹。

Therefore, if you wish to have the compiler access com.***.Example.class present in the classes directory under project A (but not in the build path of project A), then you should add 'classes' as a class folder, and not classes/com/*** as a class folder.