Search JRE in Windows

I know this question will sound very stupid, but here it’s all the same. I need to associate a new version of JRE with my application, and I can not find any version of JRE that is not in .exe, and I can not find where jre is installed on Windows 7 (a search in Windows 7 cannot find anything like this not helpful). Can someone tell me where I can download the JRE version, would it be nice to build or where can I find the path where the JRE windows are installed?

+6
java
source share
4 answers

Not sure on Windows 7, but on Windows XP the default installation is set to C: \ Program Files \ Java \ jre6

+10
source share

Alternatively, install the JDK if you have not already done so, and take the jre folder in the installation directory.

The JDK can also install it in Program Files (64-bit on 64-bit Windows, always on 32-bit Windows) or Program Files (x86) (32-bit on 64-bit Windows), as described above.

It also installs java.exe , javaw.exe and javaws.exe in C:\Windows\system32 This will be the latest installed version ...

+1
source share

corsiKa correctly applies to Windows 7 I found that the file path for jre C: \ Program Files (x86) \ Java \ jre7

For my purposes, I needed to install the Connector / J JDBC driver in the ext directory. jre7 \ lib \ int \

0
source share

I found another, more general solution that I use in Powershell. The problem is that Java now uses symbolic links to java, javaw and javac, so you cannot always rely on the use of "where.exe java" because it returns a symbolic link.

Now I rely on Java to tell where it really works, using verbose mode and parsing the output.

 $javapath=((java -verbose -version | ? {$_ -match "Opened" }).replace("[Opened ","")).replace("\lib\rt.jar]","") 

It will find the path that java actually reports about this and returns the installation directory. The only problem that I did not quite understand is that it displays additional information due to the "-version" option, but the only option is the help, which is worse. However, when launched from a script, console output can simply be ignored. If anyone has a way to stay calm, I'd love to hear it.

0
source share

All Articles