Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename a file extension with NetBeans?

I'm use NetBeans 8 for my new Maven Java Web project. The code generation really helps.

But, how Am I supposed to rename the extension of a file?

hello.jsp --> hello.xhtml

NetBeans "rename" only allow to change the first part, not the extension. Do I really have to go to my system-folder and change the file there?

like image 746
Dimitri Dewaele Avatar asked Apr 15 '14 07:04

Dimitri Dewaele


People also ask

How do I rename a file in NetBeans?

Navigate to the Project window, right-click on the project name, RenamingElements, and choose Rename…. Under Project Name enter FileSystem and tick Also Rename Project Folder; after that, click on Rename.

How do I rename a file extension?

You can also do it by right-clicking on the unopened file and clicking on the “Rename” option. Simply change the extension to whatever file format you want and your computer will do the conversion work for you.

How do you rename a file in Java?

Rename operation is possible using renameTo() method belongs to the File class in java. The renameTo() method is used to rename the abstract pathname of a file to a given pathname. The method returns a boolean value i.e. returns true if the file is renamed else returns false.

How do I rename a package in NetBeans?

Go to the NetBeans Files window ( Ctrl + 2 or using the Window -> Files menu). Left-click on the folder corresponding to the package you want to rename (i.e. test ). Type F2 and rename it.


2 Answers

You have to edit the properties. Right click on the file -> Properties.

A dialog will open where you can change the extension and more.

like image 75
ivoruJavaBoy Avatar answered Oct 06 '22 08:10

ivoruJavaBoy


you can't change the fileExtension with rightClick, when the file is open! close the editTab and then u can change the extension.

When the file is open, u get with rightClick/Properties other options!

like image 44
KraftART Berlin Avatar answered Oct 06 '22 09:10

KraftART Berlin