How can I get the latest JRE / JDK as a zip file r

2019-01-03 11:25发布

I like to be sure that everything will work just by copying the contents of the Java folder and setting the environment variables.

I usually run the installer in a virtual machine, zip the \java folder contents, go back to a snapshot of the virtual machine, and then unzip the compressed file.

I couldn't find a place where the latest JRE / JDK is available as a zip file...

http://java.sun.com/javase/downloads/index.jsp

http://download.java.net/jdk6/

Alternately, is it safe to assume that exe installer from sun just will just unzip the whole thing, without messing around with the registry, environment variables, etc...?

Related: Installing Java manually on Windows?

-- After all this time I found this site that seems to be exactly what I was looking for (2018-05-22)

30条回答
【Aperson】
2楼-- · 2019-01-03 11:43

You can download a Java Portable from PortableApps.com. It will not change your system settings. You can put it on your USB stick.

UPD: for those who needs JDK there's an open-source project OpenJDK Portable

查看更多
唯我独甜
3楼-- · 2019-01-03 11:44

I discovered you can run the installer in Wine. This works:

WINEPREFIX=/home/jason/java wine jre-7u11-windows-i586.exe

Then once it is finished you can just zip up the /home/jason/java/drive_c/Program\ Files\ \(x86\)/Java/jre7/

This should work for jdk as well

查看更多
女痞
4楼-- · 2019-01-03 11:45

The Sun JVM is available as a MSI which is executable from a script.

http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/install-msi.html

查看更多
啃猪蹄的小仙女
5楼-- · 2019-01-03 11:46

I did copy the JRE folder several times and it always works fine. But I am really not sure if you can just get a zip file with its contents, as the official installation install the plugins for IE, Firefox and whatsoever.

查看更多
手持菜刀,她持情操
6楼-- · 2019-01-03 11:47

OSX Instructions

Tested with jdk-8u74-macosx-x64.dmg.

  1. Download from Oracle the .dmg
  2. Mount the disk image
  3. Extract the .pkg, dragging it. Do not double-click (it will install).
  4. Open a terminal and cd into the package.
  5. mkdir jdk-$version && cd jdk-$version
  6. xar -xf ../JDK*.pkg
  7. cd jdkTAB
  8. tar zxf Payload
  9. The Contents/Home folder contains the JDK
查看更多
霸刀☆藐视天下
7楼-- · 2019-01-03 11:48

For JDK 8u102 things have changed, this worked for me:

  1. Download windows JDK exe
  2. Open with 7-Zip
  3. Dump contents into a directory %JDK-EXE%
  4. cmd: cd %JDK-EXE%.rsrc\1033\JAVA_CAB10
  5. cmd: extrac32 111
  6. Now have a tools.zip in directory, open it in 7-Zip
  7. Extract contents into a new directory %JDK-VERSION%
  8. cmd: cd %JDK-VERSION%
  9. cmd: for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar"
  10. src.zip is in %JDK-EXE%.rsrc\1033\JAVA_CAB9\110\ - put a copy into %JDK-VERSION%

Now you are ready to go. You might want to setup JAVA_HOME and PATH to point to your %JDK-VERSION% dir and its BIN subdir.

查看更多
登录 后发表回答