I am using NLTK's nltk.tag.stanford, which needs to call the java executable.
I set JAVAHOME to C:\Program Files\Java\jdk1.6.0_25 where my jdk is installed, but when run the program I get the error
"NLTK was unable to find the java executable! Use the config_java() or set the JAVAHOME variable"
Then I spent 3 hours on debugging it and tried
config_java("C:/Program Files/Java/jdk1.6.0_25/")
config_java("C:/Program Files/Java/jdk1.6.0_25/bin/")
and those without the ending "/".
However the nltk still cannot find it.
Anyone has idea about what's going wrong? Thanks a loooot!
If setting the JAVA_HOME environment doesn't help you, try this:
config_java() did not work for me. I add the following lines to my code and it worked:
import os
java_path = "C:/Program Files/Java/jdk1.7.0_11/bin/java.exe"
os.environ['JAVAHOME'] = java_path
I am running Windows 7 64-bit
I spent about seven hours working through this problem, and finally found a solution. You can write your java directory right into lines 69 and 72 of the internals.py file (build 2.0.4) as follows:
##########################################################################
# Java Via Command-Line
##########################################################################
_java_bin = 'C:\Program Files\Java\jdk1.7.0_25\\bin\java.exe'
_java_options = []
# [xx] add classpath option to config_java?
def config_java(bin='C:\Program Files\Java\jdk1.7.0_25\\bin\java.exe', options=None, verbose=True):
This resolves the problem for me. (I'm working in a 32 bit Windows environment)
protos1210's tip worked for me, with a few minor changes. The full answer is:
import nltk
nltk.internals.config_java("C:/Program Files/Java/jdk1.6.0_30/bin/java.exe")
After I restarted IDLE, the following code worked.
import nltk
path_to_model = "C:/Program Files/stanford-postagger-2012-05-22/models/english-bidirectional-distsim.tagger"
path_to_jar = "C:/Program Files/stanford-postagger-2012-05-22/stanford-postagger.jar"
tagger = nltk.tag.stanford.POSTagger(path_to_model, path_to_jar)
tokens = nltk.tokenize.word_tokenize("I hope this works!")
print tagger.tag(tokens)
Output is: [('I', 'PRP'), ('hope', 'VBP'), ('this', 'DT'), ('works', 'VBZ'), ('!', '.')].
I never could get it to recognize my JAVAHOME environment variables.
I looked here and the docs seem to suggest that the argument ought to look like
config_java("C:/Program Files/Java/jdk1.6.0_25/bin/java")
depending on your environment you might want to try reinstalling the nltk binary. I installed from binary and then later upgraded via easy_install and it incorrectly installed the osx version of nltk which caused exceptions when ntlk couldn't find my java binary.
I have tried all the above mentioned solutions and also the ones on Google Groups, but none worked. So after few more rounds of trial and modifications to above answers, the following piece of code worked for me :-
>>> import os
>>> os.environ['JAVAHOME'] = "C:/Program Files/Java/jdk1.8.0_31/bin" #insert approriate version of jdk
And then I tried NERTagger code :-
>>> from nltk.tag.stanford import NERTagger
>>> st = NERTagger('stanford-ner-2014-06-16/classifiers/english.all.3class.distsim.crf.ser.gz','stanford-ner-2014-06-16/stanford-ner.jar')
>>> st.tag('John has refused the offer from Facebook. He will work for Google'.split())
And the following was the output I received
'John', u'PERSON'), (u'has', u'O'), (u'refused', u'O'), (u'the', u'O'), (u'offer', u'O'), (u'from', u'O'), (u'Facebook', u'ORGANIZATION'), (u'.', u'O')]
Tested on Windows 7 64-bit
I too have been running into problems with this. It has been such a headache!
I got this to work on my machine (Win7_x64)
Replace 'jdk1.6.0_30' with your version of the jdk. Run this command:
config_java("C:/Program Files/Java/jdk1.6.0_30/bin/java.exe")
[Found C:/Program Files/Java/jdk1.6.0_30/bin/java.exe: C:/Program Files/Java/jdk1.6.0_30/bin/java.exe]
I do not know why it has been this difficult to get working. Hope this helps!
Another possibility when facing this error message while using the stanford package in NLTK is if you use StanfordTagger instead of PosTagger or NERTagger. According to Google Groups, there was a design to encourage users away from the general StanfordTagger class and towards one of the two specific taggers.
Another distinct answer for this situation is you are using an IDE such as Eclipse. Even if you have set your JAVA_HOME environment variable and even if you explicitly call config_java and you get the [Found ... /bin/java.exe] message returned to you, you could still have to set the runtime environment for your IDE. The reason is that when you invoke the tagger, config_java is called again as part of the process and your original attempts at settings the path to the java binary executable can therefore be overwritten.
I realize that this is an old question but here is the solution that worked for me (running on Windows 7-64 bit). Hopefully it will save someone some time.
I implemented the solution given here:
"I have been able to get it working by commenting out two lines in the batch_tag function in
\nltk\tag\stanford.py
The lines are line 59 and 85.
config_java(options=self.java_options, verbose=False)
and
config_java(options=default_options, verbose=False)
respectively."
After commenting out the lines I set the path to the Java executable in the same manner mentioned in other answers:
nltk.internals.config_java("path/to/javadk/bin/java.exe")
A kludgey but workable solution. Everything worked fine after that.
Hopefully this saves someone else some time when trying to fix this problem. I'm pretty new to programming, Python and the NLTK, and didn't realize when I was trying to implement #dduhaime's solution that there are two 'internals.py' files: one in the nltk folder (path=C:\nltk-2.0.4 on my computer) and one in my Python27 folder (path=C:\Python27\Lib\site-packages\nltk-2.0.4-py2.7.egg\nltk on my computer). You have to add the path to the java directory on lines 69 & 72 in the latter 'internals.py' file, or the NLTK will still not be able to find it.
My environment: Windows 7 64 bit, NLTK build 2.0.4
I implemented a workaround for this because NLTK is misunderstanding the meaning of the JAVA_HOME variable:
import os
if os.environ.get("JAVA_HOME") is not None and "/bin" not in os.environ["JAVA_HOME"]:
os.environ["JAVAHOME"] = os.path.normpath(os.path.join(os.environ["JAVA_HOME"], "bin"))
This basically takes the correct value you have in JAVA_HOME, and creates the NLTK-friendly version and stores it in JAVAHOME. NLTK will check both so this will find the binary. You need to do this before the tagger is created, obviously.
I came across the same issue and this is what worked for me which is really simple. When you are setting up JavaHome variable set the path to jdk folder in your machine like below:
C:\Program Files\Java\jdk\ - This did work
C:\Program Files\Java\jdk - This did not work
This answer is for ubuntu 14.04 .
commenting out two lines in the batch_tag function in \nltk\tag\stanford.py
The lines are line 59 and 85.
config_java(options=self.java_options, verbose=False) and
config_java(options=default_options, verbose=False) respectively.
After commenting out the lines I set the path to the Java executable in the same manner mentioned in other answers:
nltk.internals.config_java("path/to/javadk/bin/java")
Everything worked fine after that.
Related
My JAVA Programs used to run without any errors on both the Terminal and Visual Studio Code's Terminal .
After my Mac updated to MacOs Big Sur Version 11.0.1 , my JAVA programs show an error , even though the same code worked properly before .
There was no error before.
I checked my JDK and JRE Installations also
My Python files execute normally in the VS Code environment , so I do not think there is a problem with VS Code .
I have tried searching for an solution and have tried to clear the logs.
I would appreciate if anyone could guide me :)
Run the .java file in Terminal to check if JDK can work normally:
javac Hey.java
java Hey
If there's nothing wrong with the above command execution, turn to VS Code, uninstall Java Extension Pack and also delete the related folders under User/name/.vscode/extensions, then reinstall it again;
Set java.home and java.configuration.runtimes in User Settings.json.
Reference: Configure JDK.
Then run the project again to see if the problem goes away.
Install Java by searching for extensions in VSCode and try to run again.It will be executed. I belive it is not installed
You need to install the java plugin in VS Code.
Hi just found a solution here!
Initially guess it should be a problem with zsh.
so first open your terminal and type
open ~/.zshrc
at this point you will see text editor pops up with a zsh config file.
Add
export JAVA_HOME=`/usr/libexec/java_home
to the last line in that file, and save the file quit.
Then just reopen the VSC and you will notice everything would back to normal as usual.
I faced a similar problem. When running the same Java program, it worked in terminal but VS Code couldn't detect java.
All it turned out to be was I forgot to add Code itself to Path after reinstallation, nothing to do with Java.
please help. while running the NetBeans 8.2 installer, it says jdk not found on this computer. specify jdk location using "javahome installer argument". i went to the command prompt and ran the installer from there. i gave the address of the installer then --javahome "the directory of the jdk" . and it still does not run. please help me. I dont know what to do. I have tried every solution i came across but nothing works. can somebody please explain what is the problem? I have jdk 9.0.1.
First, make sure you install JDK (not JRE) on your computer.
Then, open file {path-to-netbeans}/etc/netbeans.conf and edit a line netbeans_jdkhome to
netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_144"
Such self-sure responses, such finality, all apparently basically wrong. (For three years.)
This problem appears to be a finicky demand by a lazy installer programmer. I put the JDK on the E: drive. I got past the problem with:
Apache-NetBeans-12.4-bin-windows-x64.exe --javahome E:\jdk-16.0.1\
(Note the double hyphen, as you apparently knew to do [the installer's error message box shows only -javahome] and note that putting quotes around it failed, but removing the quotes worked.)
I ran into the same, the following worked for me with Apache 12.6
Apache-NetBeans-12.6-bin-windows-x64.exe --javahome "c:\Program Files (x86)\Java\jdk1.8.0_321"
Best of luck note the double hyphens in JAVA_HOME and double quotes in JDK location. The Netbeans error screen suggests a single hyphen, but that did not work for me
After years of working OK, I'm suddenly getting this message when trying to start the JVM:
Error: could not open `C:\Program Files\Java\jre6\lib\amd64\jvm.cfg'
I tried uninstalling, and got a message saying a DLL was missing (unspecified)
Tried re-installing, all to no avail.
At the same time, when trying to start Scala I get:
\Java\jdk1.6.0_25\bin\java.exe was unexpected at this time.
Checked %JAVA_HOME% and %path% - both OK
Can anyone help?
I checked my environment variables - JAVA_HOME & PATH and they all refer to C:\java. So this was bit frustrating. After sometime I found that the default installation also copied java.exe, javaw.exe and javaws.exe to C:\Windows\System32 (i.e. uninstall of JRE didn't go well). I just removed them and voila, I'm back on track. That annoying error is no longer popping.
This works for me
So, If exists, remove java.exe, javaw.exe and javaws.exe from System32
put %JAVA_HOME%\bin at the begin of PATH.
Might be a slightly different cause, but that second issue occurs for me in scala 2.9.0.1 on Win7 (x64), though scala-2.9.1.final has already resolved this issue mentioned here:
\Java\jdk1.6.0_25\bin\java.exe was unexpected at this time.
My %JAVA_HOME% set to a path like this: c:\program files(x86)\Java\jdk...
Note the space and the parentheses.
If you change line 24 in %SCALA_HOME%\bin\scala.bat from:
if exist "%JAVA_HOME%\bin\java.exe" set _JAVACMD=%JAVA_HOME%\bin\java.exe
to
if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
It works fine. Note the quotes around the set command parameters, this will properly enclose any spaces and 'special' characters (eg: spaces and parentheses) in the variable's value.
Hope this helps someone else searching for an answer.
I had a slight different solution to this problem. my PATH and JAVA_HOME were pointing to JDK12 in
C:\Program Files\Java
but execution of the command:
Java -version
gave the error:
Error: could not open `C:\ProgramFiles\Java\jre1.8.0_212\lib\amd64\jvm.cfg'
I had to delete a folder of executables (Java.exe, javaw.exe etc.) in a different directory than System32, as other answers here and blog posts have suggested. Instead I found the problem lied with executables found in:
C:\Program Files\Common Files\Oracle
as there was nothing Java related in
C:\Windows\System32
If you're having this issue and nothing is in System32, check this "common files" directory mentioned above for an oracle directory and delete it.
After, your PATH references should work fine!
I had the same problem: I have a 64 bit Windows and when I typed "java -version" in CMD-Console i received the same Error message.
Try to start a 64bit-cmd(C:\Windows\SysWOW64\cmd.exe) and you will see, it works there ;)
C:\ProgramData\Oracle\Java\javapath
I took a back up of the files in it and removed those files from there. Then I opened a new cmd prompt and it works like a charm.
If this was working before, it means the PATH isn't correct anymore.
That can happen when the PATH becomes too long and gets truncated.
All posts (like this one) suggest updating the PATH, which you can test first in a separate DOS session, by setting a minimal path and see if java works again there.
Finally the OP Highland Mark concludes:
Finally fixed by uninstalling java, removing all references to it from the registry, and then re-installing.
scary ;)
I thought I will share how I resolved the same issue "Error Could not open lib\amd64\jvm.cfg". I found the Java run time Jre7 is missing amd64 folder under lib. However, I have 1.7.0_25 JDK which is having jre folder and also having amd64.
I moved the original contents of jre7 folder to a backup file and copied everything from 1.7.0_25\jre.
Now I am not getting this error anymore and able to proceed with scene builder.
The Java 7 install on my work PC broke after a patch was forced out to us, giving this error any time you tried to run a Java program. Somehow the entire 'lib' subdirectory of the Java 7 install vanished! Might have been related to having both Java 6 and Java 7 installed -- the 'jre6' directory still had everything there.
In any case, I fixed it by uninstalling both Java 6 and Java 7 and reinstalling just Java 7. But if the file it's complaining about is actually there, then you're likely having a path issue as described in some of the other answers here.
Had suddenly the same Problem, from one day to another eclipse said
Failed to load the JNI shared library "C:/JDK/bin/client/jvm.dll"`.
after trying to run java on the console
Error: could not open `C:\WINDOWS\jre\lib\amd64\jvm.cfg'
now i just deleted the whole directory
C:\WINDOWS\jre
and everything worked again... i don't know there this jre came from, i hope it was not a virus
Another workaround is using shortpath in windows:
open windows command console using cmd.exe
goto c:\
type command> dir program* /x
it should display as short path like: PROGRA~2
so C:\PROGRA~2 is same as C:\Program Files (x86)
in your JAVA_HOME replace path to :
C:\PROGRA~2\Java\jre7
This should work in windows 64 environment as it worked for me in win7 64bit version.
I have changed the java installation path from c:\Program Files (x86)\java to another folder like c:\java\jdk1.7 and updated the %Java_HOME% and path values accordingly,it worked.
example
%JAVA_HOME% = C:\java\JDK1.7
path-C:\java\JDK1.7\bin;
I had the same problem in Eclipse and I fixed it by changing the JRE from 64 bit to 32 bit:
Window > Preferences > Java > Installed JREs > Add... > Next > Directory > select "C:\Program Files (x86)\Java\jre1.8.0_65" instead of "C:\Program Files\Java\jre1.8.0_60"
I had a similar problem (trying to start a Jenkins slave agent on Windows) on Windows 2008R2, Java 1.7.0_15
I had two situations that contributed to the problem and that changing both of them fixed it:
1) Installing Java in a unix-compatible path (changing from c:\Program Files\... to c:\Software\...); I don't think this directly affected the problem described in this thread, but noting the change;
2) Running Java not through a shortcut. It originally failed with a shortcut, but re-running from the direct executable (C:\Software\Java...\bin\java) worked.
Reinstalling java didn't help me. But the trick to put the JAVA_HOME variable at the beginning of the env-vars. The problem occoured after an upgrade from jdk1.7.0_11 to jdk1.7.0_13
I had this problem after updating your java. The best way to solve this problem is just go to your c:/ProgramFiles/Java folder. There you will find two jre folders one is as jre.your version and other with exactly like jdk folder. Try to remove jre.1.your version folder. There you go your problem is solved. Hope this might help. It's worked for me.
Typically it because of upgrading JRE.
It changes symlinks into C:\ProgramData\Oracle\Java\javapath\
Intall JDK - it will fix this.
Error: could not open `C:\Program Files\Java\jre6\lib\amd64\jvm.cfg'
Looking # it the issue of post install script is there and getting propagated since I am using update jdk8 1.8.0_191 since issue occurred with me after installing update of java and which was happened automatically.
Error: could not open `C:\Program Files\Java\jre1.8.0_191\lib\amd64\jvm.cfg'
This will be never ending in this case and need to do workaround like changing path's manually.
Delete the jars under system32 for windows.
Delete the jars under C:\Program Files\Common Files\Oracle
Edit the environment variable set JAVA_HOME and SET PATH to bin
I have solved this issue by deleting the Oracle folder from Program Data. And also delete the oracle java path associated with that folder from environment variables.
I kept variable name as "Path" but it did not work after changing it to "PATH"
started working for me.
variable name: PATH
variable value: C:\Program Files\Java\jdk-19\bin
this will work.
It wasn't in the path. Finally fixed by uninstalling java, removing all references to it from the registry, and then re-installing. None the wiser, but back working again. Thanks all #Highland Mark- Can you tell me the process to removing references from registry. I tried all possible way people mentioned here, nothing worked.
If you have downloaded several Jdks you have to delete all except of the JDK you want to use!
I need to run a Java lib called FlowDroid in the Mac terminal.
I followed the documents and download the nighty build version of FlowDroid project.
After that, I use the commands that provided in the website but it does not work.
java -cp soot.jar;soot-infoflow.jar;soot-infoflow-android.jar;slf4j-api-1.7.5.jar; slf4j- simple-1.7.5.jar;axml-1.0.jar soot.jimple.infoflow.android.TestApps.Test "D:\Callbacks_Button1.apk" D:\Tools\AndroidSDK\sdk\platforms
I think it is a Java classpath problem, but I cannot figure it out. Whats wrong with the above commands?
As we don't have your exact error, that's pretty difficult to help. Anyway, on Mac OS X you should use the : as a classpath separator instead of ; which is for Windows systems.
Your command line should then look like:
java -cp soot.jar:soot-infoflow.jar:soot-infoflow-android.jar:slf4j-api-1.7.5.jar:slf4j-simple-1.7.5.jar:axml-1.0.jar soot.jimple.infoflow.android.TestApps.Test "D:\Callbacks_Button1.apk" D:\Tools\AndroidSDK\sdk\platforms
After years of working OK, I'm suddenly getting this message when trying to start the JVM:
Error: could not open `C:\Program Files\Java\jre6\lib\amd64\jvm.cfg'
I tried uninstalling, and got a message saying a DLL was missing (unspecified)
Tried re-installing, all to no avail.
At the same time, when trying to start Scala I get:
\Java\jdk1.6.0_25\bin\java.exe was unexpected at this time.
Checked %JAVA_HOME% and %path% - both OK
Can anyone help?
I checked my environment variables - JAVA_HOME & PATH and they all refer to C:\java. So this was bit frustrating. After sometime I found that the default installation also copied java.exe, javaw.exe and javaws.exe to C:\Windows\System32 (i.e. uninstall of JRE didn't go well). I just removed them and voila, I'm back on track. That annoying error is no longer popping.
This works for me
So, If exists, remove java.exe, javaw.exe and javaws.exe from System32
put %JAVA_HOME%\bin at the begin of PATH.
Might be a slightly different cause, but that second issue occurs for me in scala 2.9.0.1 on Win7 (x64), though scala-2.9.1.final has already resolved this issue mentioned here:
\Java\jdk1.6.0_25\bin\java.exe was unexpected at this time.
My %JAVA_HOME% set to a path like this: c:\program files(x86)\Java\jdk...
Note the space and the parentheses.
If you change line 24 in %SCALA_HOME%\bin\scala.bat from:
if exist "%JAVA_HOME%\bin\java.exe" set _JAVACMD=%JAVA_HOME%\bin\java.exe
to
if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
It works fine. Note the quotes around the set command parameters, this will properly enclose any spaces and 'special' characters (eg: spaces and parentheses) in the variable's value.
Hope this helps someone else searching for an answer.
I had a slight different solution to this problem. my PATH and JAVA_HOME were pointing to JDK12 in
C:\Program Files\Java
but execution of the command:
Java -version
gave the error:
Error: could not open `C:\ProgramFiles\Java\jre1.8.0_212\lib\amd64\jvm.cfg'
I had to delete a folder of executables (Java.exe, javaw.exe etc.) in a different directory than System32, as other answers here and blog posts have suggested. Instead I found the problem lied with executables found in:
C:\Program Files\Common Files\Oracle
as there was nothing Java related in
C:\Windows\System32
If you're having this issue and nothing is in System32, check this "common files" directory mentioned above for an oracle directory and delete it.
After, your PATH references should work fine!
I had the same problem: I have a 64 bit Windows and when I typed "java -version" in CMD-Console i received the same Error message.
Try to start a 64bit-cmd(C:\Windows\SysWOW64\cmd.exe) and you will see, it works there ;)
C:\ProgramData\Oracle\Java\javapath
I took a back up of the files in it and removed those files from there. Then I opened a new cmd prompt and it works like a charm.
If this was working before, it means the PATH isn't correct anymore.
That can happen when the PATH becomes too long and gets truncated.
All posts (like this one) suggest updating the PATH, which you can test first in a separate DOS session, by setting a minimal path and see if java works again there.
Finally the OP Highland Mark concludes:
Finally fixed by uninstalling java, removing all references to it from the registry, and then re-installing.
scary ;)
I thought I will share how I resolved the same issue "Error Could not open lib\amd64\jvm.cfg". I found the Java run time Jre7 is missing amd64 folder under lib. However, I have 1.7.0_25 JDK which is having jre folder and also having amd64.
I moved the original contents of jre7 folder to a backup file and copied everything from 1.7.0_25\jre.
Now I am not getting this error anymore and able to proceed with scene builder.
The Java 7 install on my work PC broke after a patch was forced out to us, giving this error any time you tried to run a Java program. Somehow the entire 'lib' subdirectory of the Java 7 install vanished! Might have been related to having both Java 6 and Java 7 installed -- the 'jre6' directory still had everything there.
In any case, I fixed it by uninstalling both Java 6 and Java 7 and reinstalling just Java 7. But if the file it's complaining about is actually there, then you're likely having a path issue as described in some of the other answers here.
Had suddenly the same Problem, from one day to another eclipse said
Failed to load the JNI shared library "C:/JDK/bin/client/jvm.dll"`.
after trying to run java on the console
Error: could not open `C:\WINDOWS\jre\lib\amd64\jvm.cfg'
now i just deleted the whole directory
C:\WINDOWS\jre
and everything worked again... i don't know there this jre came from, i hope it was not a virus
Another workaround is using shortpath in windows:
open windows command console using cmd.exe
goto c:\
type command> dir program* /x
it should display as short path like: PROGRA~2
so C:\PROGRA~2 is same as C:\Program Files (x86)
in your JAVA_HOME replace path to :
C:\PROGRA~2\Java\jre7
This should work in windows 64 environment as it worked for me in win7 64bit version.
I have changed the java installation path from c:\Program Files (x86)\java to another folder like c:\java\jdk1.7 and updated the %Java_HOME% and path values accordingly,it worked.
example
%JAVA_HOME% = C:\java\JDK1.7
path-C:\java\JDK1.7\bin;
I had the same problem in Eclipse and I fixed it by changing the JRE from 64 bit to 32 bit:
Window > Preferences > Java > Installed JREs > Add... > Next > Directory > select "C:\Program Files (x86)\Java\jre1.8.0_65" instead of "C:\Program Files\Java\jre1.8.0_60"
I had a similar problem (trying to start a Jenkins slave agent on Windows) on Windows 2008R2, Java 1.7.0_15
I had two situations that contributed to the problem and that changing both of them fixed it:
1) Installing Java in a unix-compatible path (changing from c:\Program Files\... to c:\Software\...); I don't think this directly affected the problem described in this thread, but noting the change;
2) Running Java not through a shortcut. It originally failed with a shortcut, but re-running from the direct executable (C:\Software\Java...\bin\java) worked.
Reinstalling java didn't help me. But the trick to put the JAVA_HOME variable at the beginning of the env-vars. The problem occoured after an upgrade from jdk1.7.0_11 to jdk1.7.0_13
I had this problem after updating your java. The best way to solve this problem is just go to your c:/ProgramFiles/Java folder. There you will find two jre folders one is as jre.your version and other with exactly like jdk folder. Try to remove jre.1.your version folder. There you go your problem is solved. Hope this might help. It's worked for me.
Typically it because of upgrading JRE.
It changes symlinks into C:\ProgramData\Oracle\Java\javapath\
Intall JDK - it will fix this.
Error: could not open `C:\Program Files\Java\jre6\lib\amd64\jvm.cfg'
Looking # it the issue of post install script is there and getting propagated since I am using update jdk8 1.8.0_191 since issue occurred with me after installing update of java and which was happened automatically.
Error: could not open `C:\Program Files\Java\jre1.8.0_191\lib\amd64\jvm.cfg'
This will be never ending in this case and need to do workaround like changing path's manually.
Delete the jars under system32 for windows.
Delete the jars under C:\Program Files\Common Files\Oracle
Edit the environment variable set JAVA_HOME and SET PATH to bin
I have solved this issue by deleting the Oracle folder from Program Data. And also delete the oracle java path associated with that folder from environment variables.
I kept variable name as "Path" but it did not work after changing it to "PATH"
started working for me.
variable name: PATH
variable value: C:\Program Files\Java\jdk-19\bin
this will work.
It wasn't in the path. Finally fixed by uninstalling java, removing all references to it from the registry, and then re-installing. None the wiser, but back working again. Thanks all #Highland Mark- Can you tell me the process to removing references from registry. I tried all possible way people mentioned here, nothing worked.
If you have downloaded several Jdks you have to delete all except of the JDK you want to use!