Reputation: 9521
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.
I see this in my project settings.
Upvotes: 138
Views: 157081
Reputation: 1
This will occur only if you are dealing with "Selenium" projects.
I was having trouble renaming the project and the project folder/directory.
I tried everything mentioned above and I was successfully able to change the name of the project but for some reason, I was not able to change the name of the project folder/directory. It was always throwing an error "https://i.sstatic.net/Qs9RbZ3n.png"
If you are facing this issue you can resolve this, by following steps. Open task manager > Close all the instances of "chromedriver/any_driver_you_are_using" > Try Renaming the project file now. It should work.
Upvotes: 0
Reputation: 5692
Actually this is a maven project and its name is defined from the maven pom.xml
So if you want to change the name you need to change its name in pom.xml
from
<artifactId>Code</artifactId>
to
<artifactId>My-project-name</artifactId>
Upvotes: 5
Reputation: 2374
Meanwhile I talk about IntelliJ 2016.2.
There are various names involved.
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.
Upvotes: 45
Reputation: 21
I had an issue renaming the project's name following the above instructions. I've tried all of the suggestions, which were very helpful and very well explained. But for some reason (maybe there is something wrong with my computer or IntelliJ installation) my project was still not renamed. I could see the new name actually between [] next to the project's old name in the left pane (i.e: oldName [newName]). I could also see the path being changed in the project's settings. However, the folder name had not changed, and when I tried to open the project in intelliJ, it was still under the old name.
If your case is like mine I found a work-around for it:
I hope that helps.
Upvotes: 2
Reputation: 9393
UPDATE IntelliJ 2021.2.3 (complete, including maven)
Covers the project, maven configuration (including multi-module), and file system folder. Eliminates project name in brackets in project view.
File | Settings | Build, Execution, Deployment
and delete all trusted locations. Related to some project security settings. In my case, Maven was broken until I did this and reset my Build Tools | Maven
settings.File | Project Structure
and enter new nameReplace in files…
Enter current project name in find box and new project name in replace box. Either selectively replace by file or click Replace all
.idea
folderOpen
, navigate to the new directory and click Ok
Notes My run configurations are stored in files and were updated. If not, per Jetbrains doc, they are stored in workspace.xml and should be updated but I did not test this. After my project opened, I rechecked for the old name and there was still one instance in a .idea xml file but this may have been an anamoly. I changed it and restarted IntelliJ just for good measure.
Upvotes: 0
Reputation: 1675
Once you have changed the project name by following the other suggestions mentioned in this thread, you can also change the module name within the project settings -> Modules:
This will change the name that is included within the brackets just next to the name of the project:
After this, proceed to refactor and rename the class that contains the main method to match your new project name. (This class is normally auto-generated by intelliJ after creating a new project).
That should do it. Cheers!
Upvotes: 2
Reputation: 203
For Gradle Springboot intellij project:
1. settings.gradle :
rootProject.name = 'new-name-project'
add/edit the above line at the bottom of the page
2. application.properties
spring.application.name=new-name-project
add/edit the above line at the top of the page
3. Go to file > project stricture > Project> Project-name: new-name-project
4. Apply and restart Intellij
Upvotes: 1
Reputation: 770
This worked for me:
Upvotes: 4
Reputation: 9581
Am using intellij 2017.2.6
Go to project view
Right Click on the top root element
Choose Refactor-> Rename
Small dialog appear -> enter the desired name
Click ok
Upvotes: 6
Reputation: 4675
Upvotes: 3
Reputation: 40438
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:
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)
Upvotes: 174
Reputation: 1326
Tips for renaming a Gradle project
Exit IntelliJ IDEA
Edit contents of the following files
{project_root}/settings.gradle
{project_root}/.idea/.name
Open IntelliJ IDEA
Refresh Gradle Project
Upvotes: 22
Reputation: 1741
I recently figured out a way to do this.
I wrote a bash script that you run from the root folder of your project (only tested on Mac) to rename all of the files in the .idea folder that contain your project name, and do a find-replace inside those files.
BE CAREFUL: Make sure your project name is unique - i.e., a project name like 'towers-of-hanoi' is unique and the script will have no problems, but a project called 'a' will, as all instances of 'a' in the files will be replaced with the new project name.
Upvotes: 0
Reputation: 2173
Following are the steps to be followed in IntelliJ Idea Community Edition:
Go to File >> Project Structure >> Project > Project Name Update project name with its new name.
Go to pom.xml Update project name with its new name in the
Select "Project" view and click root folder of the project then refactor its name.
Exit IntelliJ Idea and Rename root folder name in the windows directory structure where this project repository is stored.
Restart IntelliJ Idea and import the project using "Import project from existing resource" option.
Upvotes: 41
Reputation: 1157
If your project is file based, you cannot rename the project from within IDEA.
Convert your project to a directory based format, and then you will have the option to rename it under "File > Project Structure > Project > Project Name".
Upvotes: 1
Reputation: 119
I completed the renaming as below.
The attached image is structured in project folder.
Must make changes in the xml into a new project name.
close IDEA intellij (14.0.2)
change intellij project name (folder)
e.g) old_project_name -> new_project_name
change .idea
in folder
We have only changed the
1) artifacts in folder -> xml
2) runConfigurations in folder -> xml
3) modules.xml
4) workspace.xml
5) [your_project_name].iml
(Depending on your project structure, your folder may not contain xml
)
restart IDEA intellij
File -> Import Module...[your intellij project]
I hope this helps you :)
Upvotes: 3