简体   繁体   English

设置Eclipse项目

[英]Setting up an Eclipse project

I am planning to use Eclipse for a small java project, which I will develop together with a couple of mathematicians - hence it is important to set everything for them in a way that they can easily open the project, run one of the configurations, have all the files included etc. How can I do it in Eclipse? 我打算将Eclipse用于一个小型java项目,我将与几位数学家一起开发 - 因此,为他们设置一切,以便他们可以轻松打开项目,运行其中一个配置,包含所有文件等。如何在Eclipse中完成?

In IntelliJ (and VS for M$ languages, and any other IDE I can think of) you just create a project file and tell the other people to double click on it :) However, in Eclipse you start from selecting the directory for the workspace, and I am struggling to link it conceptually with a "project file". 在IntelliJ(以及VS for M $语言,以及我能想到的任何其他IDE)中,您只需创建一个项目文件并告诉其他人双击它:)但是,在Eclipse中,您从选择工作空间的目录开始,我正在努力将其概念上与“项目文件”联系起来。

You can do the following: 您可以执行以下操作:

  1. Define a Team Project Set, that can be used to import projects from VCS systems. 定义团队项目集,可用于从VCS系统导入项目。 To do this, share the projects to version control, and then export the projects using the Export/Team/Team Project Set wizard. 为此,请将项目共享到版本控制,然后使用“导出/团队/团队项目集”向导导出项目。 That can be imported by the corresponding Team Project Set import wizard; 这可以通过相应的Team Project Set导入向导导入; then all files will be added. 然后将添加所有文件。

  2. You can define a Run configuration where you can make any important setting (eg memory limit size settings; default parameters, selecting project/executed file), and then share this configuration as a file. 您可以定义运行配置,您可以在其中进行任何重要设置(例如,内存限制大小设置;默认参数,选择项目/执行文件),然后将此配置共享为文件。 To do this, open the Common tab in the Launch configuration settings (Run/Run configurations...), and select Save as/Shared file. 为此,请在“启动配置设置”(运行/运行配置...)中打开“公用”选项卡,然后选择“另存为/共享文件”。 Then you can save this launch configuration to your project, and that can be used to execute the program (eg first time by right clicking it, and then it will be shown together with the run configurations. In every case, make sure that you set the path parameters in a workspace relative way - eg use ${workspace_loc}/../runtime-indigoviatra 然后,您可以将此启动配置保存到项目中,并且可以用于执行程序(例如,通过右键单击它,然后它将与运行配置一起显示。在每种情况下,请确保设置工作空间中的路径参数相对方式 - 例如使用$ {workspace_loc} /../ runtime-indigoviatra

This way you can define a lot of settings together. 这样您就可以一起定义很多设置。

Another way to handle this would be to provide a workspace prepopulated. 处理此问题的另一种方法是提供预先填充的工作空间。 For this to work you have to make sure that all your collegues use the same operating system (eg Linux) with the same set of plug-ins, otherwise there might be some problems. 为此,您必须确保所有同事使用相同的操作系统(例如Linux)和相同的插件集,否则可能会出现一些问题。

Select any workspace and just create a new Java project. 选择任何工作区,只需创建一个新的Java项目。 If you want to send it to others; 如果你想把它发给别人; they have to import (as existing project into workspace) it. 他们必须将(作为现有项目导入工作空间)导入它。 Should work. 应该管用。

Also if you always want to select the workspace; 此外,如果您总是想要选择工作区; choose it from Preferences->Startup : Prompt for workspace 从Preferences-> Startup:Prompt for workspace中选择它

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

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