I need to get this exact version of java on my new mac os. I cannot find it at:
https://www.oracle.com/java/technologies/oracle-java-archive-downloads.html
Old machine:
cmuench:~$ java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
I had had previously installed java on my mac. I just downloaded a new version of java from their website. when i run java -version in my terminal I get this
omars-mbp:local omarjandali$ java -version
java version "12.0.1" 2019-04-16
Java(TM) SE Runtime Environment (build 12.0.1+12)
Java HotSpot(TM) 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)
omars-mbp:local omarjandali$
I want delete the version above and have to point it to the new java version that I just downloaded which is
version 8: (build 1.8.0_211-b12)
how can i redirect it accordingly
I installed Java 8 (jdk-8u60-windows-x64.exe) on machine with several other versions.
After installation I see the following message
d:\Userprofiles\user>java -version
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
has value '1.8', but '1.7' is required.
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
I can change JAVA_HOME to the new location but this does not fix the above message.
When I edit the registry and change 1.8 in serveral registry keys to 1.7 I have a working configuration again. But this is still 1.7.
Changing JAVA_HOME does not seem to have any effect. When I change it to my new installed JDK
d:\Userprofiles\user>java -version
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)
d:\Userprofiles\user>echo %JAVA_HOME%
D:\Program Files\Java\jdk1.8.0_60
What do I need to do to have 1.8 working on my machine? JAVA_HOME seems obsolete now, should I change the registry? What should I do to change registry so that picks up the 1.8 version?
It's not enough just to introduce the value for %JAVA_HOME% (actually, Java doesn't care if there is or there isn't such environment variable).
What you have to do is to append %JAVA_HOME%/bin directory to the Path environment variable, so that you get the java.exe that matches the %JAVA_HOME% version, without having to write the full path to the java.exe executable that you want to trigger.
So, either do this:
set a value for the %JAVA_HOME% environment variable
append %JAVA_HOME%/bin to the Path environment variable
or just
append <the-java-home-directory>/bin to the Path variable.
Personally, I would prefer to maintain a value for JAVA_HOME, as it is needed by tools like Maven, Hadoop, etc.
You can have as many JDK's installed as you want, and you don't even need them in the PATH, or to set JAVA_HOME.
The first one found in the PATH will be the default one. Remember to only install the JDK, not the JRE that always comes with the JDK, i.e. unselect the 3rd option when installing.
I have 9 JDK's installed, and I can run all of them without changing anything. All you have to do is qualify the executable:
C:\>prog\java32\jdk1.4.2_19\bin\java.exe -version
java version "1.4.2_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_19-b04)
Java HotSpot(TM) Client VM (build 1.4.2_19-b04, mixed mode)
C:\>prog\java32\jdk1.5.0_22\bin\java.exe -version
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) Client VM (build 1.5.0_22-b03, mixed mode)
C:\>prog\java32\jdk1.6.0_45\bin\java.exe -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Client VM (build 20.45-b01, mixed mode, sharing)
C:\>prog\java32\jdk1.7.0_79\bin\java.exe -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) Client VM (build 24.79-b02, mixed mode, sharing)
C:\>prog\java32\jdk1.8.0_51\bin\java.exe -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) Client VM (build 25.51-b03, mixed mode, sharing)
C:\>prog\java64\jdk1.5.0_22\bin\java.exe -version
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_22-b03, mixed mode)
C:\>prog\java64\jdk1.6.0_45\bin\java.exe -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
C:\>prog\java64\jdk1.7.0_79\bin\java.exe -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
C:\>prog\java64\jdk1.8.0_51\bin\java.exe -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
That was the output in a single Command Prompt, without ever setting the PATH.
I'm new in java and want to install Eclipse. What's appropriate version should i install as
java version "1.6.0_38"
Java(TM) SE Runtime Environment
(build 1.6.0_38-b05) Java HotSpot(TM)
Client VM (build 20.13-b02, mixed mode, sharing)
jdk1.6.0_38
jre1.6.0_38
You can install any eclipse version.There is not jdk version required for installing eclipse
For some reason the following code doesn't work on Windows XP.
new URL("file://" + tempfile.getAbsolutePath());
I'm using Java 1.6.
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)
However, the same code just works fine in OS X (Lion) and Java 1.6
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
Linux (Linux 2.6.32-38-generic #83-Ubuntu x86_64 GNU/Linux) with Java 1.6
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
Based on this the above code should work.
On the localhost the URL looks like:
file:///Folder
Very important the third slash...
On Windows the Folder looks like:
file:///C:/path/
What is the problem with File.toURI().toURL()? Why reinvent the wheel?
The following code should avoid all the hassles
new File(tempfile.getAbsolutePath()).toURI().toURL()