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?
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.
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.
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.
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.
You have to edit the properties. Right click on the file -> Properties.
A dialog will open where you can change the extension and more.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With