简体   繁体   English

关于在 Eclipse 中创建 Java 项目

[英]Regard creating a Java project in Eclipse

In the “create a Java project” wizard.在“创建 Java 项目”向导中。 For the “project layout”, there are two choices: 1) use project folder as root for sources and class files.对于“项目布局”,有两种选择:1) 使用项目文件夹作为源文件和 class 文件的根目录。 2) Create separate folders for source and class files Which one should I choose? 2) 为源文件和 class 文件创建单独的文件夹 我应该选择哪一个? For the “Working set” Whether I need to check the “Add project to working set”?对于“Working set” 是否需要勾选“Add project to working set”? What does it mean?这是什么意思?

I always choose Create separate folders for source and class files, it's just separate your src files and your output files我总是选择为源文件和 class 文件创建单独的文件夹,它只是将您的 src 文件和您的 output 文件分开

The one you choose is up to you.你选择的那一个取决于你。 It doesn't matter one way or another, at least as far as your tools are concerned.无论哪种方式都没有关系,至少就您的工具而言。

The first option means that all files will be in the root directory of the project (typically PATH_TO_WORKSPACE/projectName ).第一个选项意味着所有文件都将位于项目的根目录中(通常是PATH_TO_WORKSPACE/projectName )。 Your .java and .class files will be here if you choose that option.如果您选择该选项,您的.java.class文件将在此处。 The second option will create PATH_TO_WORKSPACE/projectName/bin and PATH_TO_WORKSPACE/projectName/src .第二个选项将创建PATH_TO_WORKSPACE/projectName/binPATH_TO_WORKSPACE/projectName/src Your source files will be in /src and your compiled files will be put into /bin .您的源文件将在/src并且您的编译文件将放入/bin

My personal preference is to not use the project folder as the root for sources and class files and to create separate folders for source and class files.我个人的偏好是不使用项目文件夹作为源文件和 class 文件的根目录,并为源文件和 class 文件创建单独的文件夹。 However, it's all up to you.但是,这完全取决于您。

In my opinion, choose different folders for sources and binaries.在我看来,为源代码和二进制文件选择不同的文件夹。 It will make source control and versioning easier.它将使源代码控制和版本控制更容易。

Working sets only make sense when you are using more than one project for one workspace.只有当您为一个工作区使用多个项目时,工作集才有意义。 I would guess that you won't need working sets until you are more experienced with Eclipse.我猜在您对 Eclipse 更有经验之前,您将不需要工作集。

  1. it is only a metter of user convinience.这只是用户便利性的一米。 eclipse is able to handle both ways. eclipse 能够处理这两种方式。
  2. working set is a way to handle eclipse workspace when you have many projects.当您有许多项目时,工作集是一种处理 eclipse 工作区的方法。 to get started, you don't need that.要开始,你不需要那个。

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

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