7

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 ?

Community
  • 1
  • 1
LoganMzz
  • 1,597
  • 3
  • 18
  • 31
  • 3
    You can unpack it from the linux version. It is exactly the same. – Peter Lawrey Nov 04 '13 at 12:30
  • 1
    A little bit update for this section: On the **step 4 the pathes was changed**. I have unzipped jdk-8u131-windows-x64.exe and the src zip was in **.rsrc\1033\JAVA_CAB9\/** folder's **110** named cabinet file (you can unzip it). – György Sipos Jun 30 '17 at 07:22

3 Answers3

2

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)
Merry
  • 21
  • 2
  • 2
    This doesn't solve the problem of missing "src.zip". The right answer has been given by @PeterLawrey : uses Linux distribution. They are mostly same. – LoganMzz Aug 11 '15 at 13:27
1

As @PeterLawrey suggested, the best way is to use Linux distribution.

LoganMzz
  • 1,597
  • 3
  • 18
  • 31
0

You can extract src.zip by following the steps mentioned below.

Note: Steps are mentioned for jdk-7u80-windows-x64.exe. Steps for JDK7 and JDK8 (for both 32bit and 64bit) are similar.

Step 1

Execute the offline installer jdk-7u80-windows-x64.exe. Let the setup screen appear. Don't press the Next button.

enter image description here

Step 2

Now now in file explorer go to the directory

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

where UserName is replaced by actual user name.

Note: For JDK 8 use the directory

C:\Users\UserName\AppData\LocalLow\Oracle\Java

enter image description here

Now the MSI and CAB files for JDK 7u80 64 bit installation will be in the directory jdk1.7.0_80_x64.

Note: For 32 bit JDK 7u80 installation the corresponding directory will be jdk1.7.0_80.

Step 3

Copy this folder to some other suitable location. Now cancel the JDK installation.

Step 4

Now in the copied folder you will find following files:

  1. jdk1.7.0_80.msi - MSI for JDK installation.
  2. sj170800.cab - Contains files required for stand alone JRE installation.
  3. ss170800.cab - Contains file src.zip.
  4. st170800.cab - Contains file tools.zip.
  5. sz170800.cab - Contains file COPYRIGHT.
bbhar
  • 599
  • 5
  • 8