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

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

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

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

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

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

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

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


当前回答

您可以下载SEVER JRE,它包含jdk。服务器jre 7

下载windows系统的server-jre-< version>.tar.gz文件。 如果你有7zip的tar文件可以通过它来解压,我用cygwin(cygwin可以安装没有管理员权限看到这个答案)用命令tar xzvf file.tar.gz来解压tar文件任何其他的tar解压器也可以工作

现在解压缩的JDK文件夹将在同一文件夹中创建。

其他回答

答案之前已经给出了。它也适用于“jdk-8u91-windows-x64.exe”

用7-zip解压,得到tools.zip 解压tools.zip到一个文件夹folder_name,这样我们就可以得到图片中的内容 在cmd下,移动到文件夹“folder_name/bin”,执行该命令 java - version

输出将是

Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

这表明有什么东西搞砸了。事实上,我们需要打开所有的包裹。

在cmd中移动到文件夹folder_name,并通过执行命令自动进行解压 在(x / r % * .pack)。\ bin \ unpack200 - r“% x”“% ~ dx % ~ px % ~ nx.jar” 再次执行第3步,如果得到如下所示的输出,那么JDK就可以使用了。


java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b15, mixed mode)

谢谢关心;JDK似乎不与Windows注册表交互。

但是,JRE在某些情况下是这样的。

链接:http://www.rgagnon.com/javadetails/java - 0604. - html

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://androidhost.org/D8wsv

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

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