Tag Archives: netbeans ide

How to Fix the “Invalid jdkhome” Error Message on NetBeans Load Tips, Tricks and Tutorials 16 OCT 2014

For NetBeans IDE users: Whenever you upgrade/downgrade your JAVA installation, more often than not you will encounter an error message when firing up NetBeans that essentially complains about not being able to locate the JAVA installation in the specified jdkhome variable:

netbeans invalid jdkhome specified error screenshot

(Note, selecting the Yes option will work 9 out of 10 times, unless of course you have completely uninstalled JAVA from your system).

It turns out that to fix this invalid jdkhome error is pretty easy. First, navigate to your NetBeans installation folder which by default should be “C:\Program Files\NetBeans 8.0” and look for the folder “etc”. Inside that folder should be a file with the name “netbeans.conf”. What you need to do is to open the file with your favorite text reader (notepad as an example) and look for the line that starts with netbeans_jdkhome=.

IMPORTANT: You might need administrative rights to save changes to this file. In that case, first open your text editor by right-clicking on the text editor icon and selecting the Run as Administrator option. (This is assuming that you are using Windows)

The next step is to alter the line to point to the currently installed JAVA JDK version. It should look something like this netbeans_jdkhome=”C:\Program Files\Java\jdk1.8.0_20″. If you are unsure as to which JDK version you currently have installed, navigate to your java’s installation folder (the default path is C:\Program Files\Java) and look for relevant JDK folder there.

Save the changes, and restart NetBeans.

edit netbeans.conf to fix jdkhome error

Simple as that.

How to Source Format multiple files in NetBeans Software & Sites 31 JUL 2013

The Alt+Shift+F or Source->Format option is one of my favourite functions in the NetBeans IDE, because it immediately makes my tangled spaghetti page of variables and logic look like a beautifully crafted and carefully laid out piece of code.

Prior to NetBeans 7.2 the Format option would only be available if you had focus on a code editor window and thus would be applied to that particular file that you were currently bashing away at. However, NetBeans 7.2 brought with it an awesome little tweak: you can now mass source format multiple files simply by selecting a file group or folder in the Projects node, Source Packages node, or Folders node window.

Having selected your targeted group and then hitting the Source->Format menu option, all files will be formatted using the source format rules currently set up under Options.

Nifty little time saver!

netbeans ide screenshot

Related Link: http://www.netbeans.org