Java version cannot be recognized on java.com - java

Recently reinstalled system and meet interesting problem. I installed java jdk8, however when I try to verify version on java.com it asks to install java. Meanwhile:
java - version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
echo %JAVA_HOME%
E:\Programms\Java\JDK8
echo %JRE_HOME%
E:\Programms\Java\JDK8\jre
echo %PATH%
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Wi
ndows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;E:\Pr
ogramms\Java\JDK8\bin;E:\Programms\Java\JDK8\jre\bin;
Java Control Panel > Security > Enable Java content in Browser is checked
Why browser and java.com does not recognize my java instalation? Java plug-in is not included in jdk?

I suspect that you need to install the JRE rather than a JDK using the Windows installer at (java.oracle.com).
This should set up everything properly.

Posting comments as an answer as per request by Yarh:
Probably the browser is 32 bits, then indeed there are not going to be any Java plugins installed in it if you installed the 64 bits Java runtime as part of the JDK. I always install the 64 bits JDK and then separately I install the 32 bits runtime through java.com (minding not to install the flipping toolbar).
There is no conflict to install both a 32 bits runtime and a 64 bits runtime, that is the advised way to support all types of browsers.

Related

Java not found.Please make sure the system environment variable JAVA_HOME points to Java version 1.8 or higher

I am trying to install PingFederate but which alerts with Java not found.Java is installed properly please help me to install without issues.
Alert comes on PingFederate Installation:
Java not found.Please make sure the system environment variable JAVA_HOME points to Java version 1.8 or higher.
Commant prompt Java installation check:
PS C:\Users\S_TEST> java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
Environment Variables:
JAVA_HOME
C:\Program Files\Java\jdk1.8.0_101
PATH
C:\Program Files\Java\jdk1.8.0_101\bin;%SystemRoot%\system32;%SystemRoot%;
%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
How are you executing PF? Command-line or as a Service? If you are running via run.bat (command-line), then you'll need to exit your terminal shell after each change to JAVA_HOME. You can also try adding "\bin" to your JAVA_HOME setting per the instructions here --> https://documentation.pingidentity.com/pingfederate/pf82/index.shtml#gettingStartedGuide/task/installingJava.html
I think you might be running 32 bit executable of your software on 64 bit machine having 64 bit jdk installed.I had same issue with android studio and then I executed "studio64.exe" instead of "studio.exe".
You might need to look installation directory of your software (which you are installing) for a 64 executable.:))

JDK not found on Debian 8.5

I want to make a python-android-app using this software. I have installed java JDK, when i run java -version i get:
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
However running the line python android.py installsdk from witin rapt directory (as described in the tutorial) tells me that i have no JDK:
I'm compiling a short test program, to see if you have a working JDK
on your system.
I was unable to use javac to compile a test file. If you haven't
installed the Java Development Kit yet, please download it from:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
The JDK is different from the JRE, so it's possible you have Java
without having the JDK. Without a working JDK, I can't continue.
You need to set your jdk to be accesible, and within path / java home :)
Here help from google:
To set JAVA_HOME environment variable, do the following: Launch
Terminal by pressing Ctrl + Alt + T on your keyboard. Depending on
where you installed your Java, you will need to provide the full path.
For this example, I installed Oracle JDK 7 in the
/usr/lib/jvm/java-7-oracle directory.Aug 13, 2012

"Error: This Java instance does not support a 32-bit JVM." [1] "Please install the desired version."

I'm using Processing 1.5.1 for Mac OS X El Capitan and when I run some code on my app it displays that message. When I type java -version I get:
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)
and when I type /usr/libexec/java_home -V I get:
Matching Java Virtual Machines (3):
1.8.0_65, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
1.6.0_65-b14-468, x86_64: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
1.6.0_65-b14-468, i386: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
I've tried setting JAVA_HOME to:
export JAVA_HOME=`/usr/libexec/java_home -v 1.6.0_65-b14-468`
but still when I reopen Processing it still displays the same error. Any help or suggestions to force it to run JVM 32-bit?
Processing 1.5 is pretty old. I wouldn't use it unless you have a very specific reason to do so. And even then, you should probably try to find a workaround.
Instead, you should try to use the latest version of Processing (right now, version 3.1.1) if at all possible. But you're using a library that hasn't upgraded yet, so you have to rely on 2.2.1.
Version 2.2.1 added a bunch of stuff over Processing 1.5, including:
Better 32 and 64-bit support. We now support separate 32- and 64-bit libraries and have added separate 32- and 64-bit versions of the Processing download. On Mac OS X, you can even select which mode you'd like to use.
I don't know if this is exactly what fixed your problem, but I would bet that Processing 2.2.1 added something that fixed the issue.
As soon as your library upgrades to Processing 3, you should upgrade your Processing version.
Selecting JVMs on a mac is a pain. I use Jenv. You could try using jenv to select a specific Java version.
brew install jenv
or have a look here:
http://www.jenv.be/
You need to register your JVMs to set it up but you can then set a default JVM and also a default local JVM for a particular directory. Very handy.
You might need to run the following correctly set JAVA_HOME:
jenv exec [your app]
Good luck.

How to install alt JDK on Mac without overriding current one

Mac here (Yosemite 10.10.5). I am using JDK 8 for all my projects, and recently just inherited an “older” Java 7-based project. I would simply like to download a Java 7 JDK from Oracle's archived JDKs, however it only seems to be available as a DMG (auto-installer).
I’m afraid that if I download this DMG it will auto-install it and make Java 7 my default installation. Whereas, I only want the unzipped JDK on my local file system, so that I can run my Java 7 app off of it (by specifying the full path to the JDK when I run the app locally).
Any ideas as to what my options are?
Most of the information about this can be found in Oracles notes on installation
I believe what you are looking for specifically is under
Determining the Default Version of the JDK:
There can be multiple JDKs installed on a system, as many as you wish.
When launching a Java application through the command line, the system uses the default JDK. It is possible for the version of the JRE to be different than the version of the JDK.
You can determine which version of the JDK is the default by typing java -version in a Terminal window. If the installed version is 8u6, you will see a string that includes the text 1.8.0_06. For example:
% java -version
java version "1.8.0_06-ea"
Java(TM) SE Runtime Environment (build 1.8.0_06-ea-b13)
Java HotSpot(TM) 64-Bit Server VM (build 23.2-b04, mixed mode)
To run a different version of Java, either specify the full path, or use the java_home tool:
% /usr/libexec/java_home -v 1.8.0_06 --exec javac -version

How do I set the default Java installation/runtime (Windows)?

I'm in the situation where I've installed the JDK, but I can't run applets in browsers (I may not have installed the JRE).
However, when I install the JRE, it clobbers my JDK as the default runtime. This breaks pretty much everything (Eclipse, Ant) - as they require a server JVM.
There's no JAVA_HOME environment variable these days - it just seems to use some registry magic (setting the system path is of no use either). Previously, I've just uninstalled the JRE after I've used it to restore the JDK. This time I want to fix it properly.
This also manifests itself with the jre autoupdater - once upon a time, I had a working setup with the JDK and JRE, but it updated and bust everything.
This is a bit of a pain on Windows. Here's what I do.
Install latest Sun JDK, e.g. 6u11, in path like c:\install\jdk\sun\6u11, then let the installer install public JRE in the default place (c:\program files\blah). This will setup your default JRE for the majority of things.
Install older JDKs as necessary, like 5u18 in c:\install\jdk\sun\5u18, but don't install the public JREs.
When in development, I have a little batch file that I use to setup a command prompt for each JDK version. Essentially just set JAVA_HOME=c:\jdk\sun\JDK_DESIRED and then set PATH=%JAVA_HOME%\bin;%PATH%. This will put the desired JDK first in the path and any secondary tools like Ant or Maven can use the JAVA_HOME variable.
The path is important because most public JRE installs put a linked executable at c:\WINDOWS\System32\java.exe, which usually overrides most other settings.
I have patched the behaviour of my eclipse startup shortcut in the properties dialogue
from
"E:\Program Files\eclipse\eclipse.exe"
to
"E:\Program Files\eclipse\eclipse.exe" -vm "E:\Program Files\Java\jdk1.6.0_30\bin"
as described in the Eclipse documentation
It is a patch only, as it depends on the shortcut to fix things...
The alternative is to set the parameter permanently in the eclipse initialisation file.
I just had that problem (Java 1.8 vs. Java 9 on Windows 7) and my findings are:
short version
default seems to be (because of Path entry)
c:\ProgramData\Oracle\Java\javapath\java -version
select the version you want (test, use tab completing in cmd, not sure what those numbers represent), I had 2 options, see longer version for details
c:\ProgramData\Oracle\Java\javapath_target_[tab]
remove junction/link and link to your version (the one ending with 181743567 in my case for Java 8)
rmdir javapath
mklink /D javapath javapath_target_181743567
longer version:
Reinstall Java 1.8 after Java 9 didn't work. The sequence of installations was jdk1.8.0_74, jdk-9.0.4 and attempt to make Java 8 default with jdk1.8.0_162...
After jdk1.8.0_162 installation I still have
java -version
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
What I see in path is
Path=...;C:\ProgramData\Oracle\Java\javapath;...
So I checked what is that and I found it is a junction (link)
c:\ProgramData\Oracle\Java>dir
Volume in drive C is OSDisk
Volume Serial Number is DA2F-C2CC
Directory of c:\ProgramData\Oracle\Java
2018-02-07 17:06 <DIR> .
2018-02-07 17:06 <DIR> ..
2018-02-08 17:08 <DIR> .oracle_jre_usage
2017-08-22 11:04 <DIR> installcache
2018-02-08 17:08 <DIR> installcache_x64
2018-02-07 17:06 <JUNCTION> javapath [C:\ProgramData\Oracle\Java\javapath_target_185258831]
2018-02-07 17:06 <DIR> javapath_target_181743567
2018-02-07 17:06 <DIR> javapath_target_185258831
Those hashes doesn't ring a bell, but when I checked
c:\ProgramData\Oracle\Java\javapath_target_181743567>.\java -version
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
c:\ProgramData\Oracle\Java\javapath_target_185258831>.\java -version
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
so to make Java 8 default again I had to delete the link as described here
rmdir javapath
and recreate with Java I wanted
mklink /D javapath javapath_target_181743567
tested:
c:\ProgramData\Oracle\Java>java -version
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
** update (Java 10) **
With Java 10 it is similar, only javapath is in c:\Program Files (x86)\Common Files\Oracle\Java\ which is strange as I installed 64-bit IMHO
.\java -version
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
After many attempts, I found the junction approach more convenient. This is very similar on how this problem is solved in linux.
Basically it consists of having a link between c:\tools\java\default and the actual version of java you want to use as default in your system.
How to set it:
Download junction and make sure to put it in your PATH
environment variable
Set your environment this way:
- PATH pointing to ONLY to this jre c:\tools\java\default\bin
- JAVA_HOME pointing to `c:\tools\java\default
Store all your jre-s in one folder like (if you do that in your Program FIles folder you may encounter some
C:\tools\Java\JRE_1.6
C:\tools\Java\JRE_1.7
C:\tools\Java\JRE_1.8
Open a command prompt and cd to C:\tools\Java\
Execute junction default JRE_1.6
This will create a junction (which is more or less like a symbolic link in linux) between C:\tools\java\default and C:\tools\java\JRE_1.6
In this way you will always have your default java in c:\tools\java\default.
If you then need to change your default java to the 1.8 version you just need to execute
junction -d default
junction default JRE_1.8
Then you can have batch files to do that without command prompt like
set_jdk8.bat
set_jdk7.bat
As suggested from #СӏаџԁеМаятіи
EDIT: From windows vista, you can use mklink /J default JRE_1.8
I simply install all the versions of JDK I need and the latest installed becomes default, so I just reinstall the one I want to be default if necessary.
I have several JDK (1.4, 1.5, 1.6) installed in C:\Java with their JREs. Then I let Sun update the public JRE in C:\Program Files\Java.
Lately there is an improvement, installing in jre6. Previously, there was a different folder per new version (1.5.0_4, 1.5.0_5, etc.), which was taking lot of space
an alterable way to run an .jar app is create an .bat cmd for it.
for example, you have jre10 and jre8 installed on your pc,and jre10 is your default jre.
but your jar is specified to work with jre8,following cmd will work:
"C:\Program Files\Java\jre1.8.0_181\bin\java.exe" -jar JabRef-4.3.1.jar
Need to remove C:\Program Files (x86)\Common Files\Oracle\Java\javapath from environment and replace by JAVA_HOME which is works fine for me
Stacked by this issue and have resolved it in 2020, in Windows 10. I'm using Java 8 RE and 14.1 JDK and it worked well until Eclipse upgrade to version 2020-09. After that I can't run Eclipse because it needed to use Java 11 or newer and it found only 8 version. It was because of order of environment variables of "Path":
I suppose C:\Program Files (x86)\Common Files\Oracle\Java\javapath is path to link to installed JRE exe files (in my case Java 8) and the issue was resolved by move down this link after %JAVA_HOME%, what leads to Java 14.1/bin folder.
It seems that order of environment variables affects order of searched folders while executable file is requested.
Thanks for your comment or better explanation.

Categories

Resources