Home > Uncategorized > fix: Java SE Development Kit (JDK) was not found on this computer

fix: Java SE Development Kit (JDK) was not found on this computer

image

I was just installing the fine IDE NetBeans 6.9 and its installer asked me to install the Java JDK first. It was saying "Java SE Development Kit (JDK) was not found on this computer" (see screenshot). The dialog points one to download the JDK at http://java.sun.com/javase/downloads. Since Oracle acquired Sun, now that redirects to http://www.oracle.com/technetwork/java/javase/downloads/index.html.

The JDK seems to be included in Java SDK now together with GlassFish Enterprise Server, so their page takes you to that when you ask for the latest JDK (btw, the version numbers can confuse you since the SDK has a lower version number than the JDK that’s included in it).

After installing the SDK (JDK and GlassFish etc.), I created a batch file (install-netbeans.bat) to launch the NetBeans installer with the appropriate parameter (was too bored to try the alternative of setting the JAVA_HOME environment variable in Computer’s Advanced Properties at Windows):

netbeans-6.9-ml-windows.exe -javahome "c:/somefolderpath/glassfishv3/jdk/bin"

…but I kept on getting the same error dialog again and again. Then I did a web search for "netbeans installer javahome" and came across FaqInstallJavaHome NetBeans wiki entry where I noticed that whereas Netbeans 4.x/5.x used "-is:javahome", NetBeans 6.x uses "–javahome".

YES, WITH TWO DASHES IN FRONT of "javahome" installer argument! Totally foreign syntax to Windows world (but not to Unix commands and the Java runtime launcher syntax [at least in recent years]). Even worse is that it’s almost impossible to notice the double dash with the font face used in that error dialog.

All was finally fine using this one (just added the extra dash to write –javahome instead of -javahome):

netbeans-6.9-ml-windows.exe –javahome "c:/somefolderpath/glassfishv3/jdk/bin"

About these ads
Categories: Uncategorized Tags:
  1. 2010/11/08 at 12:51 | #1

    To sum up:
    1) place NetBeans installer on the desktop
    2) create a runme.bat file (say using Notepad – make sure you write “test.bat” at save dialog, not “test.txt” or “test.bat.txt”) at the same folder
    3) put the above “netbeans-6.9-ml-…” command (the one in bold) on a single line in the batch (runme.bat) file. Do modify the last path appropriately to point to where you installed glassfish
    4) save the batch file (ANSI encoding)
    5) double-click the runme.bat on the desktop to launch it and proceed with the installation

  2. Dennis
    2011/01/17 at 04:48 | #2

    Hey there. I’m having the same problem installing the Android SDK. I’ve installed the Java JDK like it wanted, but I get the same “java SE development kit not found” error. I tired the batch as you have listed but it still pops up with the same error. I tired both -javahome and -is:javahome, with one and two hyphens.

    Have any suggestions on this? Thanks man, Dennis

    • 2011/01/17 at 12:37 | #3

      Android uses Google’s own Java VM (with incompatibilities and Android-specific customizations probably), that’s why they got a lawsuit from Oracle. Do you try to use Android with NetBeans? Can you provide more details?

  3. Dennis
    2011/01/18 at 01:09 | #4

    I’m just starting out with it. I need to use adb in command to push some files to my phone, but need to have the Android SDK installed to use it. All it seems to need is the Java SE development Kit. I just tried installing it directly to C: rather then Program Files, but the Android SDK installer still isn’t seeing it.

    • 2011/01/20 at 22:31 | #5

      can define JAVA_HOME environment variable on windows or pass the java home as commandline parameter to the installer if it accepts such

  4. Dennis
    2011/01/18 at 01:30 | #6

    I think I got it worked out by downloading a previous version of the Android SDK. It gave me the files to unzip and manually place in the directory. adb commands are working now. Thanks man.

  5. alejojau
    2011/02/08 at 03:05 | #7

    I was trying the same above but didnt work, i was installing netbeans 6.5.1; the thing its after you check the “javac” command and shows information, you must change the compatibility of the installing file, with the windows service pack 3 and then run the file.

  6. 2011/02/08 at 12:16 | #8

    Do you mean on Windows 7 to set that you want to run javac using compatibility mode, as Windows XP SP3?

    On Vista I didn’t need to do so, I wonder why Windows 7 would need such setting. But I usually have UAC (User Access Control) turned off, so that might be your use. In that case you could try to check “Run as administrator” at the Compatibility tab instead of selecting Windows XP SP3 there.

  7. 2011/02/08 at 12:20 | #9

    btw, speaking of UAC, your could also try setting the installer itself to run as administrator the same way, but the issue is that sometimes installers unpack other executables and somehow manage to run them in non-admin mode (probably they don’t launch them as child processes as they should have).

    The proposed solution by Microsoft is to use an elevated command prompt in that case, that is go to Start/Search and type cmd and then right click the item “CMD Shell” (command line prompt window) that is displayed in the Start menu and select “Run as administrator”.

    Then into the elevated command prompt window you can drag-drop the executable file of the installer and when it shows the command there press ENTER to launch it. All executables the installer unpacks and runs will then also run as administrator (it seems then they all run as child processes of the elevated command prompt).

  8. Merong
    2011/04/04 at 15:50 | #10

    Merong :

    Dennis :
    Hey there. I’m having the same problem installing the Android SDK. I’ve installed the Java JDK like it wanted, but I get the same “java SE development kit not found” error. I tired the batch as you have listed but it still pops up with the same error. I tired both -javahome and -is:javahome, with one and two hyphens.
    Have any suggestions on this? Thanks man, Dennis

    i also have same problem installing Android SDK….why?

    try this out….run the Android SDK installer(installer_r10-windows)..then do not click “next” first…
    follow this step:
    -find “javac.exe” normally in C:Program Files/Java/jdk1.6.0_24/bin/javac
    -then click on “javac.exe”
    -back to SDK installer> click next..
    that all..

  9. 2011/04/04 at 16:54 | #11

    Hi Merong, read about this trick with Android SDK at other posts too, not sure if single click on javac.exe is needed there or double-click and then answer yes to any UAC security questions

  10. Yuval
    2011/07/04 at 20:57 | #12

    Double click on Javac.exe solved the problem for me !

    Thanks for the tip !

  11. DK
    2011/09/15 at 04:19 | #13

    I installed Java NetBeans 6.5.1 properly in my laptop and it worked. But after using it, I tried to uninstall it. Before uninstalling NetBeans, I uninstalled some other files of Java and now when I try to uninstall NetBeans I receive an error “Java SE Development Kit (JDK) was not found on this computer” and when I try to install NetBeans I receive an error “NetBeans IDE 6.5.1 and JDK 6 update 13 are already installed.” Now please tell me how to fix it.

  12. 2013/11/29 at 20:25 | #14

    I’m having the same problem with the program pssav

  13. 2013/11/29 at 20:25 | #16

    I’m having the same problem with the program pssav windows 8

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,225 other followers

%d bloggers like this: