Set UTF-8 encoding on Netbeans

Update Netbeans file encoding

If you use an operating system which default file encoding is not UTF-8 (e.g. Windows) it is sometimes beneficial to change the file encoding NetBeans IDE will use.

Logo by
NetBeans IDE Logo

NetBeans IDE will use, as all Java applications, the operating system’s file encoding by default. To force the ide to use UTF-8, the following configuration needs to be added to the netbeans_default_options parameter


The parameter netbeans_default_options is defined in the file


Before the update the parameter definition could look like

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true"

After the change it should then look like

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dfile.encoding=UTF-8"

After a restart UTF-8 is used as file encoding.