Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No "src.zip" when extracting JDK installer

I have followed this procedure : How can I get the latest JRE / JDK as a zip file rather than EXE or MSI installer?. In order to get JDK w/o admin rights. However, I still miss the source archive "src.zip".

When I open the installer with 7-Zip, it only shows "tools.zip" file. Here is the command-line output:

C:\Users\mlogan\Downloads>7z.exe l jdk-7u45-windows-i586.exe

7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18

Listing archive: jdk-7u45-windows-i586.exe

--
Path = jdk-7u45-windows-i586.exe
Type = PE
CPU = x86
Characteristics = Executable 32-bit
Created = 2013-10-08 17:03:06
Physical Size = 129487776
Headers Size = 1024
Checksum = 129505985
Image Size = 129503232
Section Alignment = 4096
File Alignment = 512
Code Size = 62976
Initialized Data Size = 129425408
Uninitialized Data Size = 0
Linker Version = 10.0
OS Version = 5.1
Image Version = 0.0
Subsystem Version = 5.1
Subsystem = Windows GUI
DLL Characteristics = Relocated NX-Compatible TerminalServerAware
Stack Reserve = 1048576
Stack Commit = 4096
Heap Reserve = 1048576
Heap Commit = 4096
Image Base = 4194304
----
Path = .rsrc\JAVA_CAB10\111
Size = 83877914
Packed Size = 83877914
--
Path = .rsrc\JAVA_CAB10\111
Type = Cab
Method = LZX
Blocks = 1
Volumes = 1

Date       Time     Attr          Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2013-10-08 08:42:32 ....A    181321555               tools.zip
------------------- ----- ------------ ------------  ------------------------
                             181321555    129487776  1 files, 0 folders

Have you any idea on how to retrieve the source archive ?

like image 234
LoganMzz Avatar asked Nov 04 '13 12:11

LoganMzz


1 Answers

According to the latestest answer by Piero Ottuzzi in his post http://www.brucalipto.org/java/how-to-create-a-portable-jdk-1-dot-8-on-windows, Oracle seems to no longer include src.zip from update 45. You could always use tools.zip to have a portable JDK.

Steps to follow on Windows to have a portable JDK:

  1. Download the installer, eg. jdk-8u51-windows-x64.exe, into a folder, eg. "downloads", that contains 7z.exe.

  2. Extract tools.zip from the installer with 7-Zip: open a command prompt and type

    D:\downloads>7z x jdk-8u51-windows-x64.exe
    
  3. Extract the content of tools.zip to a folder, say "jdk", with 7-Zip: type in the command prompt

    D:\downloads>7z x tools.zip -ojdk
    
  4. Move to the folder jdk and transform .pack files to .jar files: type in the command prompt

    D:\downloads>cd jdk
    D:\downloads\jdk>for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar"
    

The folder jdk is the wanted portable jdk. To test it, type in the command prompt:

D:\downloads\jdk>.\bin\java -version

You would get

java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
like image 144
Merry Avatar answered Nov 15 '22 11:11

Merry