我希望通过复制Java文件夹的内容并设置环境变量来确保一切都能正常工作。

我通常在虚拟机中运行安装程序,压缩\java文件夹内容,回到虚拟机的快照,然后解压缩压缩文件。

我找不到一个地方有最新的JRE / JDK压缩文件…

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

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

另外,假定sun的exe安装程序只是解压缩整个文件,而不会弄乱注册表、环境变量等等,这是否安全?

相关:在Windows上手动安装Java ?

-- 经过这么长时间,我找到了这个网站,似乎正是我要找的(2018-05-22)


当前回答

You can just use 7zip (or another similar app) to get the dirs inside the core.zip file that's bundled in the installer. Just use 7zip to browse the exe, you'll see a core.zip file which has all the files that usually go inside "jreX" dir (where X is the major version number). As for setting env variables and the such, you can follow the other answers. If all you want is a portable jre (for example, you can run your jars by using java.exe jarfile or javaw.exe jarfile) then this solution will do. This is very similar to copying the jre dir from one place to another

其他回答

这个链接

http://www.java.com/en/download/manual.jsp

至少可以帮助你避免讨厌的预加载安装程序直接进入SDK。

从那里,我将把它安装在一个一次性的VM,在你的旧的杂乱的PC或其他地方,然后转移结果

C:\Program Files (x86)\Java\jre7

(或类似)到你的新机器,设置很少的常用ENV变量,理想情况下,你就可以实现了,没有所有的营销垃圾和潜在的捆绑。当然,也没有安全的频繁自动更新。

下面提示中的命令包装为批处理脚本。保存为unpack.bat。然后将它与jdk/jre提取文件一起放置到dir。

@echo off

cd /d "%~dp0"
for /r %%x in (*.pack) do .\bin\unpack200 -r "%%x" "%%~dx%%~px%%~nx.jar"

我发现你可以在Wine中运行安装程序。如此:

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

一旦完成,你可以压缩/home/jason/ Java/ drive_c/ program \ Files\ \(x86\)/Java/jre7/

这应该也适用于jdk

从http://www.processing.org/download/下载Processing应用程序。zip文件包含一个名为java的文件夹。它包括JDK 1.6.0_32(版本检查于19/02/2013)。

http://androidhost.org/D8wsv

您可以从上面的链接获取jre-7u75-windows-i586.zip。