简体   繁体   English

日食问题中的.classpath文件

[英].classpath file in the eclipse question

In the eclipse directory, there is .classpath file. 在eclipse目录中,有.classpath文件。 What's the purpose of this file? 这个文件的目的是什么? I have ant build.xml available, why Eclipse still need its own? 我有ant build.xml,为什么Eclipse还需要自己的?

Eclipse has its own mechanism for building your project. Eclipse有自己的构建项目的机制。 The .classpath file contains information that the IDE uses to create the classpath used at build-time, runtime etc. You can directly edit this file if you want but it is created by the IDE based on the settings that you provide via the project properties dialog. .classpath文件包含IDE用于创建在构建时,运行时等使用的类路径的信息。您可以根据需要直接编辑此文件,但它是由IDE根据您通过项目属性提供的设置创建的。对话。

There is Ant integration within Eclipse insofar as it provides you a specific editor for build files, but it can't use any of the information in the build file for its own builders. Eclipse中有Ant集成,因为它为构建文件提供了特定的编辑器,但它不能将构建文件中的任何信息用于其自己的构建器。 Ant files are custom, so there is no way Eclipse could know what info to use. Ant文件是自定义的,因此Eclipse无法知道要使用的信息。

The reason for this is that it doesn't matter if you have an Ant file or not. 这样做的原因是,如果你有一个Ant文件并不重要。 The reason for the presence of this file is that this is a Java Project, and the corresponding Project nature always generate such a file. 存在此文件的原因是这是一个Java项目,相应的项目性质始终生成这样的文件。 Create a normal Project (New->Project->General->Project) and you'll see that there is no .classpath file. 创建一个普通的项目(New-> Project-> General-> Project),你会发现没有.classpath文件。 In general I would recommend to split those functionalities in separate projects, that means one Java Project for developing, one non-Java-Project for executing your Ant scripts. 一般情况下,我建议将这些功能拆分为单独的项目,这意味着一个用于开发的Java项目,一个用于执行Ant脚本的非Java项目。

HTH Tom HTH Tom

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

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