Error: could not open `D:\IntelliJ IDEA Community Edition 2018.2.5\JDK\lib\amd64\jvm.cfg'
I get this error every time I try to run a java program. Before it was working fine when i had JDK 8 but i upgraded to 14. I use VScode and I had deleted Intellij but the file path hasn't gone and the terminal is trying to find the intelliJ JDK for some reason. I am a beginner to terminal too. I have tried setting up the environment variable for the correct path but that isn't working.The path variable doesn't have the intelliJ reference in it and i have even set up the JDK_HOME but even that isn't working.
Edit: I have downloaded a extension called Terminal Manager but don't know how to configure it.Will it work?(Edit: It doesn't, it's not what i thought it is used for)
Yet another edit: Is there a way to specify the path for JDK every time I use java commands in the terminal and does it have auto-completion(using tab). Should i just reset my machine because i can't seem to figure out this problem.
Where java in the command prompt gives C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe, not the path for the JDK 14. I updated the environment var path to point to the latest JDK but now i get INFO: Could not find files for the given pattern(s). in the command prompt.
In VScode, on opening the Configure JavaRuntime,That is showing me 4 paths, 2 are the correct ones(one is labelled current), one empty and the invalid path. I can't seem to find any way to remove the incorrect one. Though it has the correct path, it still searches for the deleted file.
Update: The program now compiles but every time it shows:
Build Failed
Debugger for Java
Proceed Fix Cancel
I click fix and clear the workspace cache but it doesn't work. It runs without the debugger but it would be better if it worked.
Install the "choose runtime" plugin this will allow you to select the runtime your self.
Start the IDE, use (Ctrl+Shift+A or Cmd+Shift+A on Mac), type "Choose Runtime", press Enter.
You will be able to download the latest version from here and it will be automatically configured to the config path
Related
I am running Windows 10 and I recently ran into a problem with opening Eclipse. Originally, I was unable to use the javac command on command prompt because of a message that said: "javac is not recognized as internal or external program". To fix this, I went into the environment variables and added the PATH variable, which was not there before, and made the address to the bin folder in my Java folder. This fixed that problem and allowed me to use javac and run my files, however, now I am unable to open Eclipse. Whenever I run Eclipse, The program starts to load then fails and refers me to the log. In the error log I get this:
So far, I deleted that PATH variable then retried Eclipse and an error message said it was unable to find a javaw.exe file. I found my java files and put the path to that file in my eclipse folder and tried eclipse again. This time, eclipse started to load but then failed and referred me back to the error log. It seems that eclipse is able to find the javaw.exe file but I'm not sure what else is wrong now.
My Eclipse and Java versions were not compatible. IF anyone else has this problem make sure of that first. After fixing this, I went to the PATH environment variable and I was able to add multiple paths, so I added both of these:
C:\Program Files\Java\jdk1.8.0_161\bin
and
C:\Program Files\eclipse\jre\bin
The first path is necessary to use javac from command prompt. The second address is necessary for eclipse to access the javaw.exe file.
I'm new to Stack Overflow (though a long time lurker).
I'm struggling to install elasticsearch on my laptop. It's windows 8, I've just updated java to Java 8 and I've set the new path using set JAVA_HOME.
However, whenever I try to run the elasticsearch.bat file on the command line, I get this error:
\elasticsearch-5.0.2\bin\..\config\jvm.options was unexpected at this time
Any help would be greatly appreciated on this matter
I've also tried to setup the ElasticSearch on my Windows 2016 R2 Datacenter (64-bit). Let me share some of my experiences on how to solve this.
Setting up JAVA_HOME
Ensure that you have JDK/JRE installed. You can download it here.
Set the JAVA_HOME environment variable. To do this, open the Start menu and type in "path".
Then click on Environment Variables. If you don't have JAVA_HOME variable set yet, click New.
The JAVA_HOME variable should only lead up to the JDK/JRE directory, not including /bin.
C:\Progra~1\Java\jdk1.8.0_112
Progra~1 corresponds to Program Files. If you use Program Files (x86), change Progra~1 to Progra~2
Restart your computer. Once your computer is restarted, open up CMD and type in echo %JAVA_HOME%. The output should be
C:\Progra~1\Java\jdk1.8.0_112
If you get the following output, your JAVA_HOME is setup correctly.
Running ElasticSearch
The first time I tried to run ElasticSearch, I get the following output.
The odd directory I pointed out here gave me a hint that the batch file might be reading from the wrong directory. So what I did was tinker around with the batch file a bit. Open elasticsearch.bat using any text editor.
Scroll all the way to the end, somewhere above the last lines you'll see something similar to the following.
Remove the highlighted line, save the file and try running the batch file again via command prompt.
It works in my case.
Once you have this, open up your browser and navigate to localhost:9200.
I think that's it?
Your problem is most likely caused by parentheses in the path to where you unzipped and are running Elasticsearch from. The related issue in the Elasticsearch repository is #24712 which will be fixed with Elasticsearch 5.4.1.
Be aware that by applying Nicholas Lie's "fix" you are telling Elasticsearch to effectively ignore all settings in config/jvm.options. While this may help you to start Elasticsearch in this specific case, it will only start with default JVM options which might lead to surprising behavior down the road.
I am brand new at Java and have been trying to write "Hello World!". I have gotten far enough to install java with jdk and I've see countless videos on the environmental variables and setting those up with the paths. In the CMD when I write Java or Javac, it works fine, but trying to do step #4 (compiling) on this step by step site: http://www.codejava.net/java-core/how-to-write-compile-and-run-a-hello-world-java-program-for-beginners
I get completely stuck. Its when I am trying to "change the directory" that it tells me that the system cannot find the path.. Right now I'm at a complete loss.
Any suggestions on what I need to do? I am happy to post screen shots if that will assist as well.
Java error picture:
When running the command in the prompt window, Windows is looking at the PATH environment variable.
Make sure that the bin directory of the JDK is referenced in that variable.
I have installed jdk1.6 in E: drive of windows 7.I developed a simple .java file and try to run it through the command prompt using "javac" but it says javac is not recognized as internal or external command.So i checked just by running java it runs fine .so I thought that i should uninstall that jdk and reinstallit but i am getting windows 1723 error
opened a control panel and tried to remove jdk from there but got this "Error 1723.There is problem with this Windows Installer package.A DLL required for this install to complete could not be run.Contact your support personnel or package vendor"
to be able to run javac from the command line, you need to add the path to javac to the PATH environment variable.
It looks like the 1723 error describes a problem with the installer itself. I would follow the advice from Microsoft Answers and Oracle to fix the installation. A correct install of Java should add the necessary entry on the Windows PATH. Make sure you open a new DOS (or Command) window after installation otherwise the amended PATH might not be picked up.
Probably,you are facing the below issue: https://forums.oracle.com/forums/thread.jspa?threadID=2213081. You can use ccleaner to uninstall all the instance of jdk/jre.The issue is happening due to interrupting in installing/uninstalling.If ccleaer is not solving your problem registry cleaning is the only option as shown on the above link.
You probably have java.exe on your \windows\system32 folder... And since this folder is on the path env var it got confused. Try to delete this/these java*.exe files from \windows\system32 folder.
If you encountered a problem with Java error 1723 when you try to reinstall Java.
It may occur when you delete the Java directory by error
_ Go to your Microsoft Event Viewer you'll see one error line like this
Event viewer
_ Then copy an Java bin directory from an other server to have back the lost dlls in the directory mentioned in the events viewer
_ finally reinstall Java
Hope it helps
I have used Microsoft utility(fix-problems-that-block-programs-from-being-installed-or-removed) to resolve this error it saved me doing manual work and it is safe also :
https://support.microsoft.com/en-us/help/17588/fix-problems-that-block-programs-from-being-installed-or-removed
I had installed Java in my PC and it was working perfectly. Suddenly something went wrong and now I m not able to open swing applications and its showing the error 'Java not found'. But I can run the Eclipse IDE which also needed Java to run. So I decide to reinstall the Java, but when I tried to uninstall the Java it shows the Error 1723 - There is a problem with this Windows Installer Package. So I have installed a new JDK in another location and set the PATH. Still I am not able to run the Swing application.
Can anybody help me on this?
How are you running your swing application?
If it's from the command line like java mySwingApp and you're getting java not found then your PATH isn't set properly. Make sure that the java/bin directory is on your PATH not just the top level directory. You can test your PATH by just typing java in a console window - it should print the java help page.
If you're not running from a terminal like above, then you may need to set a JAVA_HOME environment variable which points to your java installation folder. Here's a tutorial on setting JAVA_HOME
Setting JAVA_HOME
Hope this helps,
Will
This is close to jakob's answer, about trying to get your Java install setup correctly again, just with a little more detail.
I had a similar problem on my Windows 7 box where I was trying to uninstall Java and do a clean install of a newer version. Something got messed up and I would get the 1723 error message during the uninstall and attempted reinstall. Here's information about how I was able to fix the problem, and maybe this will help you:
Look at the log files for the uninstall/reinstall. On Windows 7 they can be found at c:\users\username\AppData\Local\Temp\
The java_install.logdidn't show any extra information, but I had several MSI##### log files that contained error messages about the failed uninstall. The message was: Error 1723.There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action UninstallJRE, entry: MSIUninstallJRE, library: C:\Program Files\Java\jre6\bin\regutils.dll
There was indeed no regutils.dll file, and not even the bindirectory was there. So I copied over a regutils.dll file from another computer, ran the uninstaller, and it worked. Then the new clean install of Java also worked.
So take a look at your logfiles and hopefully that will give you more detailed information about the 1723 error.
This usally happens when you delete Java files manually.
If you try to uninstall Java and it fails, it generates a log file.
Should be in C:\Users[Username]\AppData\Local\Temp
Almost at the end the missing file(s) can be found.
Try to copy that file(s) from a working installation to your computer.
Then you should be able to uninstall your Java and install a new version.