A collaborator has sent me some Matlab code which requires an old MCR version (7.14). I have an installation binary from them, but when I run it I am immediately faced with the message
No Java Runtime Environment(JRE) was found on this system
Has anyone experienced this before? I cannot get around the problem. I have JRE installed. I am running Ubuntu 18.04.
Thank you for any help.
One possible cause may be that JAVA_HOME environment variable is not set, or that it is set incorrectly. The variable should point to the installation directory for the JRE / JDK whose java command you are running.
(Note: a correct JAVA_HOME is never a bin directory, so if you have set your $JAVA_HOME to a bin directory you have done it wrong!)
Thus, the solution may simply be to set the JAVA_HOME environment variable (correctly) in your shell before running the MCR installer.
I have used it [the MCR installer] successfully on numerous other Ubuntu machines.
This is suggestive to me that your problem is an incorrect JAVA_HOME ...
Another possible solution would be to follow the instructions in the MATLAB documentation for doing a "non-interactive" install of MCR.
There is apparently a README file in the zip file. It may contain information about command line options for the installer that relate to the version you are using.
Finally, I suspect that the install command is actually a shell script. There may be clues in the script about command line options and other alternatives for installing.
Related
Please help. I'm having issues syncing up my JDK and jpackage versions for creating standalone java programs. The JDK version and the runtime version being included with jpackage are mismatched (JDK16 programs being paired with JDK15 runtimes).
Typing java -version into the command line, it matches up with the current %JAVA_HOME% environment variable configuration, showing JDK16.0.2 (located at C:\Program Files\Java\jdk-16.0.2). This is working correctly.
However the problem becomes more apparent when I type jpackage --version, it reports that it's using JDK15.0.1 - which as far as I know, I've never installed and I'm unsure of where it's running from. This is a problem, since I need to be able to build Java16 programs with jpackage. As it is now, this results incompatible runtimes and JAR files.
I've been googling to no avail. I can't compile my JDK16 programs into installers because it keeps trying to use JDK15.0.1 for the runtime.
For now, I've managed to bypass this strange and seemingly locked configuration by accessing JDK16's jpackage exe manually this way and adding the commands after:
“C:\Program Files\Java\jdk-16.0.2\bin\jpackage.exe”
Any advice is helpful. Perhaps this temporary workaround will be helpful to anyone else with the same problem down the line.
Use the Windows where command to find out what the jpackage command is actually resolving to. It seems clear that jpackage without the full path name is resolving to jpackage in a different installation of Java.
Note that %JAVA_HOME% does not determine how the Windows cmd.exe resolves commands. Command resolution is done according to %PATH%.
The symptoms you describe:
jpackage says %JAVA_HOME% is incorrect but %JAVA_HOME% refers to Java 16
jpackage -version says Java 15 (not Java 16)
"C:\Program Files\Java\jdk-16.0.2\bin\jpackage.exe" works
are all consistent with your %PATH% being incorrect ... and that you do have a Java 15 installation on your machine, and it is on the %PATH% ahead of, or instead of the Java 16 installation you are trying to use.
Note jpackage is no longer an "incubator" tool in Java 16. It has been promoted to full support; see JEP 392: Packaging Tool. So the warnings about incubator mudules are also consistent with jpackage resolving to the wrong Java installation.
This really boils down to understanding what the Windows %PATH% variable is and how it effects the behavior of Windows command shells. (It is analogous to $PATH in Linux, UNIX and Mac OSX command shells.)
I recently came across a library that I needed to use, Jpcap, that requires a 32-bit JVM to run. After installing 32-bit Java on my machine running Ubuntu and configuring my application in Eclipse (Mars) to use that version of Java, I encountered the following error,
Exception occurred executing command line.
Cannot run program "/usr/lib/java/jre1.8.0_91/bin/java" (in directory "/home/[USERNAME]/EclipseWorkspace/[APPNAME]"): error=2, No such file or directory
I have verified that the path to the JRE directory is correct and that the java executable is present. Is there some configuration step that I'm missing? Does anyone have an idea of why Eclipse might not be able to get to that directory?
You may have forgot to update the JAVA_HOME environment variable. If that's the case you may want to follow this guide:
https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get
Basically you can use sudo update-alternatives --config java to get the java installation path and then edit, as su, the file /etc/environment adding or editing the field JAVA_HOME="YOUR_PATH", where YOUR_PATH is the actual java installation path. At this point you can either restart your machine or just reload the environment variable by typing source /etc/environment.
Hope this helps!
why do I get this? How can I fix it?
C:\Users\ash>java version
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
has value '1.7.0_01', but '1.7' is required.
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
The accepted solution for Reinstalling ALL JDKs was a bit harsh.
I too experienced this problem and here is my 2 cents:
This problem started happening since I installed JDK 8 and still had JDK 6 installed. I need for different projects I'm working on.
I noticed I had both a User and a System %JAVA_HOME%, so I removed my User %JAVA_HOME% variable and left only the system one.
I also noticed that in my Oracle installation there was some Java executables and I believe those where the ones conflicting since both my Oracle and Java installations were in my %PATH% variable.
I removed all Java paths from my %PATH% Variable and only left the %JAVA_HOME%\bin at the start of the variable for avoiding any conflicts with the Oracle installation.
I had a similar issue after installing the java 1.8.
To fix this go to Advance System setting --> path and remove
C:\ProgramData\Oracle\Java\javapath;
Removing
C:\ProgramData\Oracle\Java\javapath;
work like charm
Reinstall JDK and set system variable JAVA_HOME on your JDK. (e.g. C:\tools\jdk7)
And add JAVA_HOME variable to your PATH system variable
Type in command line
echo %JAVA_HOME%
and
java -version
To verify whether your installation was done successfully.
I had a similar issue after installing the java 10.0
To fix this go to Advance System setting --> path and remove
C:\ProgramData\Oracle\Java\javapath;
I had to remove the Common Files javapath from the 'Path' that was conflicting, in order to make it work. Now thankfully the java -version works just fine.
C:\Program Files (x86)\Common Files\Oracle\Java\javapath
Make sure your JDK Path variable is directing to the \bin folder and is at the top of the list, because it always uses the first match. By moving it to the top you can make sure that no other path is matched first.
If there's any other entry that has a file called java (such as C:\ProgramData\Oracle\Java\javapath) it will run the command against that file instead of the java file in your JDK. There's no need to reinstall the entire JDK unless your files are corrupt or damaged for some reason.
This problem generally occurs in Windows when your "Java Runtime Environment" registry entry is missing or mismatched with the installed JDK. The mismatch can be due to multiple JDKs.
Steps to resolve:
Open the Run window:
Press windows+R
Open registry window:
Type regedit and enter.
Go to: \HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\
If Java Runtime Environment is not present inside JavaSoft, then create a new Key and give the name Java Runtime Environment.
For Java Runtime Environment create "CurrentVersion" String Key and give appropriate version as value:
Create a new subkey of 1.8.
For 1.8 create a String Key with name JavaHome with the value of JRE home:
Ref: https://mybindirectory.blogspot.com/2019/05/error-could-not-find-javadll.html
I edited my path to put the Oracle JDK at the start of the path and that fixed it.
Problem:
We had the same problem in our Windows 2012 server. We used JAVA_HOME environmental system variable, an we used in the PATH this kind of settings: ...%JAVA_HOME%/bin;...
and no other java related settings was in the PATH.
The problem was we had a space at the end of the value of the JAVA_HOME variable. Like 'C:\Program Files\Java\Jdk 1.8.0_172 ' so the %JAVA_HOME%/bin meant 'C:\Program Files\Java\Jdk 1.8.0_172 \bin'. So because the value was split by space and the system tried to find java.exe at 'C:\Program Files\Java\Jdk 1.8.0_172' where it is obviously not.
Solution was: Delete the space from the end of value of the JAVA_HOME !
Uninstall Java from machine
Check Java folder is deleted from Program Files
Check Registry does not have any instance of Java
Open system Variables and delete the ONLY java path from PATH
Now install the new version again.
Set the Path in System Variables.
This process cleans up all the traces of java and then install fresh java.
Note: This issues occurs when there is multiple installation and uninstall done.
You could be using a 32 bit version of java on a 64 bit environment.
Export the registry hive form HKLM\Software\JavaSoft and import into HKLM\Software\Wow6432Node\JavaSoft. For 1.6 I only needed JavaHome and RuntimeLib values.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Javasoft]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Javasoft\Java Runtime Environment]
"CurrentVersion"="1.6"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Javasoft\Java Runtime Environment\1.6]
"JavaHome"="C:\\Java\\jre"
"RuntimeLib"="C:\\Java\\jre\\bin\\client\\jvm.dll"
None of the above worked for me, unfortunately.
The error solved when I uninstalled the old JDK versions that were installed on my computer. I did it simply with the "Uninstall or change a program" tool (under the Control Panel).
I removed the "C:\Program Files (x86)\Heroku\bin" from PATH variable and the problem has gone. I think it is probably the Heroku require different version of Java. So check all directories in your PATH variable, remove the possible ones may have confliction.
If you face this error in cmd with another error as "could not find runtime environment" after you have done all settings in Environment Variable. Then you just need to run jre.exe in your jdk folder and reinstall it and then recheck it by java -version command. Hope it will help you.
rename file "C:\Windows\System32\java.exe" to "C:\Windows\System32\java_old.exe"
CMD --> java -version
done.
In my case the regedit information was correct and the problem was solved by doing the below:
1) setting JAVA_HOME to jdk - set JAVA_HOME=C:\Program Files\Java\\bin
2) setting PATH to jre - set PATH="C:\Program Files\Java\\bin"
after adding the requirements path as illustrated up and deleting C:\ProgramData\Oracle\Java\javapath;. don't forget to reopen your editor.
Go to CMD and type the following:
SET PATH=C:\Program Files\Java\jdk1.8.0_291\bin
(here jdk1.8.0_291 represents your java version, it may differ for you)
Ok, this is embarrassing, but I can't install Java. I have no experience in Java so any help appreciated.
So as ussual I install Java JDK (The JRE I think is already there before) I have jre7 and jdk1.8.0.0_05
I have install it, but Java still not in my computer
Here's some desperate cmd check
>C:\>WHERE java
>INFO: Could not find files for the giving pattern
>C:\>java
>'java is not recognized as an internal or external command, operable program or batch file.
Where my java folder is C:\Program Files (x86)\Java\jdk1.8.0.0_5
On my desperation I created the variable JAVA_HOME on the given directory. Afterward, I tried this.
>C:\>echo %JAVA_HOME%
%JAVA_HOME%
I was expecting the cmd to echo the directory.
The variable PATHEXT has the following in it:
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
Clariffication:
I tried to reinstall the Java Jdk Installer with Windows Installer, but no luck.
If this matters, I'm running from Windows 7.
I tried to learn from Here
After closer inspection, I can run java and javac after going all the way into the directory (so inputing java outside the bin will do nothing good)
Add C:\Program Files (x86)\Java\jdk1.8.0.0_5\bin to your PATH variable
Here is how mine is
I think you may have not added JAVA_HOME environment variable, and/or to PATH environment variable neither.
Give a read to this article
http://www3.ntu.edu.sg/home/ehchua/programming/howto/jdk_howto.html
Regarding you last comment, i think you should put the java directory right infront of all the other directory because, if you were to install another version of java it might not be used if you place it behind.
(For Advanced Users Only)
I suggested that you place the JDK bin directory in front of "c:\windows\system32" and "c:\windows". This is because some Windows systems may have an out-dated copy of JDK/JRE in these directories. Do a search for "java.exe", and you will be amazed by the findings.
You could read "Java Applications and Environment Variable" for more discussions about PATH environment variable.
I also recommend that you define an environment variable called JAVA_HOME, which contains the JDK installed directory, and include the JDK bin directory in the PATH via JAVA_HOME, i.e., PATH=%JAVA_HOME%\bin;.....
I have just installed ant and JDK 6 and am trying to run an ant task. I get the following:
C:\Users\Giles Roadnight\workspace\Parsley\build>ant compile_spicelib_complete_flex
Buildfile: build.xml
compile_spicelib_complete_flex:
[exec] Error loading: C:\Program Files\Java\jdk1.6.0_17\jre\bin\server\jvm.dll
[exec] Result: 6
BUILD SUCCESSFUL
Total time: 0 seconds
C:\Users\Giles Roadnight\workspace\Parsley\build>
That file - jvm.dll is definitely there. I have tried running as an administrator with the same result.
To install I ran the JDK installer (I already had a JRE installed), I set up JAVA_HOME in my environment variables.
I unzipped ant and added my ant bin directory to my PATH.
I am clueless about Java and how it all works so am a bit lost with this.
I am on 64 bit windows 7. I downloaded a 64 bit JDK.
Any help much appreciated.
you must have Unzipped your flex to some folder. I am referring to this folder as flex_sdk.
Add flex_sdk to the FLEX_HOME environment variable (creating the environment variable if necessary).
Flex compiler needs a 32 bit JRE since there is currently no support for 64 bit JRE. For this, first download a 32 bit(or X86) version of jdk and later have the flex sdk point to it.To do so, you'll need to edit the jvm.config file located in FLEX_HOME\bin. Within jvm.config, set java.home to the location of your 32 bit JDK as shown.(Note that these are not backslashes)
Example: java.home=C:/Program Files (x86)/Java/jdk1.6.0_25 Alternatively, you can also add an environment variable with the name JAVA_HOME and have it point to the above location if you are not able to find the jvm.config file.
/I had the same problem and researched on this for a couple of days. Tried 100s of classpaths and loads of corrupted registry issues. The above solution seemed to work for me. Let me know if it works for you as well/
-Prasad K
It looks to me as if the ant script is running a native program which in turn tries to load the JVM to run some java code, and fails. I would guess that there is a mismatch between 32-bit and 64-bit-ness. The package you are trying to run is, in this theory, using a 32-bit Windows executable which is failing to LoadLibrary the 64-bit JVM DLL.
A simpler possible explanation is that many things in the Java universe get befuddled by spaces on pathnames. Try installing the JDK in a pathname with no embedded spaces.
You can solve this by creating a bat file in the flex-sdk bin directory with the following:
"%JAVA_HOME%\bin\java.exe" -Xmx384m -Dsun.io.useCanonCaches=false -jar "%~dp0\..\lib\mxmlc.jar" +flexlib="%~dp0\..\frameworks" %*
Then invoke this bat file instead of mxmlc.exe
Note: solution found at https://web.archive.org/web/20120327204229/http://sray.squidpower.com/2010/01/13/solution-to-error-running-mxmlcexe-with-windows-64bit-jvm/
The first part that surprises me is that it tries to use the server JVM instead of the regular one, but that might be a feature of your build. The second thing I'd try is to run ant -v instead of plain ant. This should give you a lot more output and hopefully more information as to what ant is trying to do at this point in time.