简体   繁体   English

如何从 IntelliJ 中现有的 package 创建新项目?

[英]How to create a new project from an existing package in IntelliJ?

I am new to any IDEA and I am using IntelliJ recently.我是任何 IDEA 的新手,最近我正在使用 IntelliJ。

I am asking if I have three classes in a package, one class contains the main method, I have opened this package in IntelliJ IDEA but the RUN icon is greyed out.我在问我是否在 package 中有三个类,一个 class 包含主要方法,我已经在 IntelliJ IDEA 中打开了这个 package,但 RUN 图标是灰色的。

How could solve this problem or how could I create a project from this package?如何解决这个问题,或者我如何从这个 package 创建一个项目?

在此处输入图像描述

In some IntelIJ products there is button to import the project.在某些 IntelIJ 产品中,有用于导入项目的按钮。 Import means it will convert the project from other ide to IntelIJ project.导入意味着它将项目从其他 ide 转换为 IntelIJ 项目。

But it is not always possible.但这并不总是可能的。 Usually you can open only projects created in that IDE.通常您只能打开在该 IDE 中创建的项目。

You can create new project and create classes with same names, also pay attention to "Edit configuration" that is usually near Run button.您可以创建新项目并创建具有相同名称的类,还要注意通常靠近运行按钮的“编辑配置”。 In configuration you can specify which file you want to compile and run and what compiler you want to use.在配置中,您可以指定要编译和运行的文件以及要使用的编译器。 For example, you want to run 'main' method of class Bounce.java using java version 1.8.例如,您想使用 java 版本 1.8 运行 class Bounce.java 的“主要”方法。

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

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