在没有Maven的Eclipse中创建src / main / java文件夹结构 [英] Creating a src/main/java folder structure in Eclipse without Maven
问题描述
如何在我的默认Web应用程序中创建 src / main / java
和 src / test / java
项目在Eclipse中没有Maven?我当前的文件夹结构是
How do I create the src/main/java
and src/test/java
in my default web application project in Eclipse without Maven? My current folder structure is
TestApp
-JavaResources
- src
- com.mypackage
-WebContent
推荐答案
,你不能在另一个源文件夹中有一个源文件夹,所以在创建 src / main / java
之前,你必须告诉Eclipse不要对待 src
作为源文件夹。为此,请右键单击 src
文件夹,然后选择构建路径 - >从构建路径中删除。
As you've discovered, you can't have a source folder inside another source folder, so before you can create src/main/java
you have to tell Eclipse not to treat src
as a source folder. To do this, right click on the src
folder and select build path -> remove from build path.
一次您已经完成了 src
将出现在其正常位置的文件夹树中,因此您可以创建 main
和 java
文件夹,并将现有的 src / com
移动到 src / main / java / COM
。最后右键单击新创建的 java
文件夹,然后选择构建路径 - >用作源文件夹。
Once you have done this src
will appear in the folder tree in its normal place, so you can create the main
and java
folders under it, and move the existing src/com
to src/main/java/com
. Finally right-click the newly-created java
folder and select build path -> use as source folder.
这篇关于在没有Maven的Eclipse中创建src / main / java文件夹结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!