Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Renaming a project in IntelliJ IDEA

I have some projects where the directory containing the project is called "Code".

When I open IDEA, in my recent projects list all I see is that name.

Is there any method to change this in settings ?

I tried going to File->Project Structure->Project, I couldn't find the Project Name option in IntelliJ IDEA 13.

This is what I see when I open Project Settings I see this in my project settings.

like image 232
yasith Avatar asked Jan 17 '14 03:01

yasith


People also ask

How do I rename a project name?

Renaming ProjectsRight-click the root folder of your project and select Refactor | Rename from the context menu or press Shift+F6 . In the dialog that opens, choose the rename strategy. If the project name is the same as the name of its root folder, select Rename directory.

How do you rename a project in Java?

To rename the project, simply right-click the project and select "Refactor/Rename...". Fill in the new name and click OK.

How do I rename a project folder?

Right click the namespace → Rename.... This should search and replace all references to your namespace throughout the project. Close the project → rename the project folder.


2 Answers

You can change the project name, which is the name that is shown in the recent projects list, like so:

Go to Project Structure (Ctrl+Alt+Shift+S) → Project Settings / Project → Project name:

enter image description here

Please note that this is not to be confused with name of the root module, or folder on the file system, which may or may not be similar.

Edit

Please try going into your .idea folder in the project, create a file named .name and enter a project name on a single line.

e.g.

my-new-project-name 

Then restart IntelliJ.

This presumes you are using a folder-based Idea project in .idea (rather than file based, with .iws file etc)

like image 115
vikingsteve Avatar answered Oct 13 '22 16:10

vikingsteve


Meanwhile I talk about IntelliJ 2016.2.

There are various names involved.

  1. Red the folder name. I.e., the folder where the project is located. This name appears the the project structure and in the path on the top window.
  2. Blue the name of the iml file. You can rename the iml file, when the iml file is different from the folder name, you have them both in the project view.
  3. Yellow the project name can be set as described by @vikingsteve (Project Structure (ctrl-alt-shift-s) -> Project Settings / Project -> Project name) in the response above. You will find the project name written in the file ".name" in the .idea folder. It is also the name which appears in the open recent file list.
  4. brown if your project is a maven project, you will additionally have the artifact id in the pom.

Usually all these names are the same which makes life easier.

Sometimes they are not. There are many reasons why they should be different. E.g., this helps me to differentiate project versions (I also use the image background feature of IntelliJ 2016.2) when I have simultaneously the same project on two branches.

While you change these names, IntellJ may generate a new *.iml with the artifactId name (brown). In this case just delete the *.iml file you don't want to keep.

IntelliJ project name

like image 35
fan Avatar answered Oct 13 '22 16:10

fan