如何將最新的JRE / JDK作爲zip文件而不是EXE或MSI安裝程序? [關閉]

本文翻譯自:How can I get the latest JRE / JDK as a zip file rather than EXE or MSI installer? [closed]

I like to be sure that everything will work just by copying the contents of the Java folder and setting the environment variables. 我喜歡通過複製Java文件夾的內容和設置環境變量來確保一切正常。

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. 我通常在虛擬機中運行安裝程序,壓縮\\ java文件夾內容,返回虛擬機的快照,然後解壓縮壓縮文件。

I couldn't find a place where the latest JRE / JDK is available as a zip file... 我找不到最新的JRE / JDK可用作zip文件的地方......

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

http://download.java.net/jdk6/ 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...? 或者,可以安全地假設來自sun的exe安裝程序只是解壓縮整個事情,而不會弄亂註冊表,環境變量等......?

Related: Installing Java manually on Windows? 相關: 在Windows上手動安裝Java?

-- After all this time I found this site that seems to be exactly what I was looking for (2018-05-22) - 經過這段時間我發現這個網站似乎正是我想要的(2018-05-22)


#1樓

參考:https://stackoom.com/question/6nLa/如何將最新的JRE-JDK作爲zip文件而不是EXE或MSI安裝程序-關閉


#2樓

Here is a good, but a little complex, way: 這是一個很好但有點複雜的方式:

Stage 1: MSI & CAB from native installation file 第1階段:來自本機安裝文件的MSI和CAB

  1. Download the JRE or JDK from the Oracle (Sun) website. 從Oracle(Sun)網站下載JRE或JDK。 This method will work on any version and on SDK or JRE. 此方法適用於任何版本以及SDK或JRE。

  2. Run and wait for the installer to load. 運行並等待安裝程序加載。 Minimize the window. 最小化窗口。

  3. In Windows 7, you should browse to this location: 在Windows 7中,您應該瀏覽到以下位置:

    C:\\Users\\ YOUR_USER_NAME \\AppData\\LocalLow\\Sun\\Java C:\\ Users \\ YOUR_USER_NAME \\ AppData \\ LocalLow \\ Sun \\ Java

  4. There, you will have a few MSI and CAB files. 在那裏,您將擁有一些MSI和CAB文件。

在此輸入圖像描述

Stage 2: easily extract the MSI & CAB using uniextract 第2階段:使用uniextract輕鬆提取MSI和CAB

  1. Browse to Universal Extractor | 瀏覽到Universal Extractor | LegRoom.net and download UniExtract Binary Archive . LegRoom.net並下載UniExtract 二進制存檔

  2. Use WinRar or any un-RAR program available to you, and extract uniextract161_noinst.rar anywhere. 使用WinRar或任何可用的非RAR程序,並在任何地方解壓縮uniextract161_noinst.rar

在此輸入圖像描述

Stage 3: finally, extract the inner container named core.zip 階段3:最後,提取名爲core.zip的內部容器

  1. Drag & drop jdk1.6.0_31.msi or jre1.6.0_31.msi on the icon of UniExtract.exe . 拖放上UniExtract.exe的圖標jdk1.6.0_31.msijre1.6.0_31.msi。

  2. Select "Extract Method: MSI Administrative Installer". 選擇“提取方法:MSI管理安裝程序”。 Wait for the process to finish. 等待該過程完成。

  3. Enter the new created folder. 輸入新創建的文件夾。

    If you've drag-and-dropped jre1.6.0_31.msi you should have a jre1.6.0_31 folder 如果你拖放jre1.6.0_31.msi你應該有一個jre1.6.0_31文件夾

  4. Follow all levels inside and you'll see core.zip . 按照裏面的所有級別,你會看到core.zip 在此輸入圖像描述

  5. This is what you are after. 這就是你所追求的。 You can just unzip it anywhere and you'll have the content of the Java runtime or SDK without installing anything on your system. 您可以在任何地方解壓縮它,您將擁有Java運行時或SDK的內容,而無需在系統上安裝任何內容。

* You can now close the installer of Java you've left opened in stage 1 * *您現在可以關閉您在第1階段打開的Java安裝程序


#3樓

You can just use 7zip (or another similar app) to get the dirs inside the core.zip file that's bundled in the installer. 你可以使用7zip(或其他類似的應用程序)來獲取安裝程序中捆綁的core.zip文件中的dirs。 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). 只需使用7zip瀏覽exe,您將看到一個core.zip文件,其中包含通常位於“jreX”目錄內的所有文件(其中X是主要版本號)。 As for setting env variables and the such, you can follow the other answers. 至於設置env變量等,你可以按照其他答案。 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. 如果你想要的只是一個便攜式jre(例如,你可以使用java.exe jarfile或javaw.exe jarfile運行你的jar),那麼這個解決方案就可以了。 This is very similar to copying the jre dir from one place to another 這與將jre dir從一個地方複製到另一個地方非常相似


#4樓

Here is a link for JDK 5 zip file. 這是JDK 5 zip文件的鏈接。 sun-jdk-5-win32-x86-1.5.0.12.zip sun-jdk-5-win32-x86-1.5.0.12.zip


#5樓

This link 這個鏈接

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

helps you at least avoid the obnoxious preload installer getting straight to the SDK. 幫助您至少避免令人討厭的預加載安裝程序直接訪問SDK。

From there, I would install this in a throw-away VM, on your old crufty PC or elsewhere, then transfer the resulting 從那裏開始,我會將它安裝在一臺丟棄的虛擬機上,在你的老式PC或其他地方,然後傳輸結果

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

(or similar) to your new machine, set the very few usual ENV variables, and there you ideally go, w/o all the marketing junk and potential tie-ins. (或類似的)你的新機器,設置極少數常見的ENV變量,理想情況下,你沒有所有的營銷垃圾和潛在的搭配。 Of course, also w/o the security from frequent automatic updates. 當然,也沒有經常自動更新的安全性。


#6樓

I discovered you can run the installer in Wine. 我發現你可以在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/ 然後一旦完成,你可以/home/jason/java/drive_c/Program\\ Files\\ \\(x86\\)/Java/jre7/

This should work for jdk as well 這也適用於jdk

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章