Cannot locate java installation in specified jdkhome netbeans как исправить

[Article updated in January 2019] I recently came across this message when opening NetBeans after updating my Java version. Cannot locate Java installation in specified jdkhome: C:Program FilesJa…

Leon Atherton Leon is a developer at IDRsolutions and product manager for BuildVu. He oversees the BuildVu product strategy and roadmap in addition to spending lots of time writing code.

September 4, 2012 47 sec read

[Article updated in January 2019]
I recently came across this message when opening NetBeans after updating my Java version.

Cannot locate Java installation in specified jdkhome:
C:Program FilesJavajdk1.8.0_191
Do you want to try to use default version?

There are no ill effects from clicking Yes, and everything works as normal within NetBeans, but it’s certainly annoying having to click Yes every time you open NetBeans.

I tried every menu I could find within NetBeans, but was unable to make the message go away. Thankfully, you can fix this message by editing a config file in the NetBeans installation directory located at /etc/netbeans.conf. You will need to open it as an administator to have permission to modify it. For me it was located at:

C:Program FilesNetBeans 8.2etcnetbeans.conf

On MacOS you can find it at:

/Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf

The line you are looking for is:

netbeans_jdkhome="C:Program FilesJavajdk1.8.0_191"

Which was on line 57 for me.

Simply change this to your current Java version or comment it out completely, and you should no longer see that annoying message! If you comment the line out (by putting a # at the start), the NetBeans launcher will automatically detect and use a JDK. This works for NetBeans 8 with Java 8 and beyond.


Our software helps Java Developers to

View PDF files in a web application →

Parse PDF files as HTML →

Display PDF Forms in a web browser →

View PDF Documents in Java Applications →

Rasterize PDF Documents to image →

Read/Write images (including HEIC, JPG and WEBP) →

Convert Image files to PDF Documents →

Leon Atherton Leon is a developer at IDRsolutions and product manager for BuildVu. He oversees the BuildVu product strategy and roadmap in addition to spending lots of time writing code.


This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters

Show hidden characters

NetBeans “Cannot locate java installation in specified jdkhome”?
I recently came across this message when opening NetBeans after updating my Java version from 1.7.0_05 to 1.7.0_07.
Cannot locate Java installation in specified jdkhome:
C:Program FilesJavajdk1.7.0_05
Do you want to try to use default version?
There are no ill effects from clicking Yes, and everything works as normal within NetBeans, but it’s annoying having to click Yes each time you open NetBeans right?
I tried every menu I could find within NetBeans, but was unable to make the message go away. Thankfully, you can fix this message by editing a config file in the NetBeans installation directory located at /etc/netbeans.conf. For me this was:
C:Program FilesNetBeans 7.2etcnetbeans.conf
The line you are looking for is:
netbeans_jdkhome=»C:Program FilesJavajdk1.7.0_05″
Which was on line 57 for me.
Simply change this to your current Java version and you should no longer see that annoying message!
Update August 2015:
In the comments, Andrew has recommended that it’s possible to comment the above line out (put a # at the start) and the launcher will automatically detect and use a JDK, which will work for NetBeans 8 with Java 8 and beyond.
This post is part of our “NetBeans article Index” series. In these articles, we aim to explore NetBeans in different ways, from useful hint and tips, to our how-to’s, experiences and usage of the NetBeans IDE.

I uninstalled JDK 1.6.26, then installed JDK 7 and changed my PATH to point to the new version.

However when I now open NetBeans it shows me this error:

enter image description here

Cannot locate java installation in specified jdkhome:
C:Program FilesJavajdk1.6.0_25
Do you want to try to use default version?

How can I make JDK 7 the default JDK that NetBeans uses?

Gaff's user avatar

Gaff

18.3k15 gold badges56 silver badges68 bronze badges

asked Sep 14, 2011 at 12:00

Milad Sobhkhiz's user avatar

Milad SobhkhizMilad Sobhkhiz

2711 gold badge6 silver badges17 bronze badges

2

Locate netbeans.conf and change the following according to your JDK location:

"netbeans_jdkhome="C:Program FilesJavajdk1.7.0_01""

It will solve your problem.

The file may not have writing permission for a regular user so make sure to give yourself permission to write the file if you are unable to save the changes.

The Unknown Dev's user avatar

answered Oct 24, 2011 at 11:45

Jubayer Arefin's user avatar

1

First, try checking your other environment variables for references to the old path. Specifically, check JAVA_HOME and JRE_HOME.

I don’t know about NetBeans, but Eclipse tends to remember the JDK location in an internal setting. You may need to reset the path in the NetBeans preferences.

Finally, try searching your registry for references to the old JDK path.

answered Sep 14, 2011 at 13:39

Chris Nava's user avatar

Chris NavaChris Nava

7,1751 gold badge26 silver badges30 bronze badges

3

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 FilesNetBeans 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 FilesJavajdk1.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 FilesJava) and look for relevant JDK folder there.

Save the changes, and restart NetBeans.

edit netbeans.conf to fix jdkhome error

Simple as that.

When I was trying to launch the NetBeans, I got the following message.

It happened after I updated java from jdk1.8.0_25 to jdk1.8.0_191.

I did the following to get rid of this message.

1. Open the C:Program FilesNetBeans 7.4etcnetbeans.conf

2. Search the file for «jdkhome» to locate the line
      netbeans_jdkhome=»C:Program FilesJavajdk1.8.0_25″

3. Change it to  netbeans_jdkhome=»C:Program FilesJavajdk1.8.0_191″

——————————————————————————————————————
Watch the blessing and loving online channel: SupremeMasterTV live

If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book for free here.

A few years ago a friend told me about Netbeans, the freebie Java-based code editor that is designed to work with Java, PHP and a range of other languages. At that point it was time to retire Homesite, my favorite editor for over 10 years that was no longer sold or supported, and was showing signs of incompatibility issues with Windows updates.

netbeans-01I have since found Netbeans to a great editor, with all of the advanced features found in Homesite and other good code editors. Recently, I was a bit surprised to see the error message, “Cannot locate java installation in specified jdkhome” pop up when I tried to start Netbeans after a recent Java update. When you see this error, you can click the Yes button and Netbeans will work as it did before the update, but the error message is a bit of a nuisance because you have to click the button each time Netbeans is started.

The root of the problem is that when a new version of Java was installed during the Java update, the old version was deleted and the new version placed in a different directory. That may have been done intentionally to defeat viruses that were looking for Java in old directory location. The remedy for the error message is to edit the netbeans.conf configuration file found in the C:Program FilesNetBeans 7.1.2etc directory. Your version of Netbeans may may have a different version number in the path, or the path could be different depending upon the Netbeans version and when it was installed. The important part is that you need to find the netbeans.conf file.

Look for the line that reads:

netbeans_jdkhome="C:Program FilesJavajre6"

and change it to:

netbeans_jdkhome="C:Program FilesJavajre7"

Note that the name of the java directory was changed from jre6 to jre7. Make sure that you use a pure text editor, such as Notepad, to make the changes. Never use a word processor to edit configuration files because word processors sometimes embed codes in the configuration file.

You can avoid the error entirely by refusing to do the Java update for your PC, but given the severity of the recently discovered Java vulnerabilities, it would be much wiser to keep Java updated if you need Java to run applications on your personal computer.

If you have not tried using Netbeans and are looking for a new code editor with advanced features, it may be worthwhile to give Netbeans a spin. It does work well and the best part is the price.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Cannot load bmaframe dll error code 0x45a
  • Cannot load asacpi dll как исправить
  • Cannot launch the resource script module because it is disabled ошибка packet tracer
  • Cannot initialize steam error
  • Candy ctd 8766 коды ошибок

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии