417

I like to be sure that everything will work just by copying the contents of the Java folder and setting the environment variables.

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.

I couldn't find a place where the latest JRE / JDK is available as a zip file...

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

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...?

Related: Installing Java manually on Windows?

-- After all this time I found this site that seems to be exactly what I was looking for (2018-05-22)

Community
  • 1
  • 1
opensas
  • 60,462
  • 79
  • 252
  • 386
  • 2
    Java installer will (or at least should) set JAVA_HOME. Probably it does other things too as the Java will probably not find its way to the Windows Control Panel by itself. And as far as I know, there's no ZIP available from Sun. Though I've never tried to find one. – Carlos Oct 25 '09 at 01:36
  • 2
    "... but I like to be sure that just by copying the contents of the java folder and setting the environment variables, everything will work fine.". WHY? – Stephen C Oct 25 '09 at 01:41
  • 7
    public jre's mess with the windows folders to provide a java.exe in the default path. – Thorbjørn Ravn Andersen Oct 25 '09 at 08:22
  • 1
    yeap, that's the sort of things I'm trying to avoid... – opensas Oct 25 '09 at 12:55
  • 12
    In support of this question: I have to install a JRE by hand to avoid my company's tendency to break it with "Fixes" remotely installed. Currently I install it, copy it then uninstall it to hide it from them--seems kind of annoying but the way it is now breaks our entire dev setup with every patch. – Bill K Aug 14 '12 at 18:04
  • With the release of Java 8 Oracle provides an archive that doesn't need installation - although only for the JRE: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html (download the .tar.gz files) –  May 21 '14 at 13:18
  • 2
    @Carlos I cannot tell you how many times I've had to manually set JAVA_HOME on all the different computers I install Java on. When I format my computer, it always burns me because Maven requires it to be set and forces me to fix it. I do not know why it fails to set for me yet works for others (since I've had this problem on Windows XP, 7, and 8). I always thought that the installer was supposed to do that for me but just ended up doing it myself out of frustration. – Water Sep 13 '15 at 21:04
  • 1
    Can I just copy the jdk installation folder from another computer to mine without install it ? –  Oct 12 '15 at 09:44
  • 1
    Since quite some time Oracle offers tar.gz for Windows 32 and 64 bit on the official download page, and there is also the Windows x64 server-jre bundles. – eckes Sep 24 '17 at 01:29
  • From JDK 11 we can get the zip download for windows directly from oracle website. – Anver Sadhat Oct 09 '18 at 09:56
  • https://installbuilder.com/java/ -> answer – Debadatta Jul 07 '20 at 16:02

30 Answers30

553

JDK is not available as a portable ZIP file, unfortunately. However, you can follow these steps:

  • Create working JDK directory (C:\JDK in this case)
  • Download latest version of JDK from Oracle (for example jdk-7u7-windows-x64.exe)
  • Download and install 7-Zip (or download 7-Zip portable version if you are not administrator)
  • With 7-Zip extract all the files from jdk-XuXX-windows-x64.exe into the directory C:\JDK
  • Execute the following commands in cmd.exe:
    • cd C:\JDK\.rsrc\1033\JAVA_CAB10
    • extrac32 111
  • Unpack C:\JDK\.rsrc\1033\JAVA_CAB10\tools.zip with 7-zip
  • Execute the following commands in cmd.exe:
    • cd C:\JDK\.rsrc\1033\JAVA_CAB10\tools\
    • for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar" (this will convert all .pack files into .jar files)
  • Copy all contents of C:\JDK\.rsrc\1033\JAVA_CAB10\tools where you want your JDK to be
  • Setup JAVA_HOME and PATH manually to point to your JDK dir and its BIN subdirectory.
Mr. Polywhirl
  • 42,981
  • 12
  • 84
  • 132
Igor
  • 5,750
  • 2
  • 16
  • 7
  • This doesn't register the DLLs though, so the debugging tools like `jmap` or `jhat` won't work. – barfuin Jun 20 '12 at 19:55
  • When I did this, I would get an error : Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object. The problem is that the unpack200 command above renames the .pack files to .pack.jar, and I believe the java executable expects them to be named just .jar. I am not expert enough in Windows scripting to know how to change that command, so I manually went into each folder and where there was a file names x.pack.jar, I renamed it to x.jar, and got rid of the .pack file. – Jim Jarrett Feb 06 '13 at 14:05
  • 27
    If you want to automate it, once you have 7-zip installed you can just use the 7z.exe utility that's installed along with it to do all the extraction (it also replaces extrac32 in this solution). So for example: `7z e jdk-7u15-windows-x64.exe .rsrc/JAVA_CAB10/111` `7z e 111` `7z x -ojdk_dir tools.zip` and then delete the temporary 111 and tools.zip files and do the unpacking. The unpacking under msys/cygwin can be done with: `find jdk_dir -name "*.pack" -exec sh -c 'jdk_dir/bin/unpack200 -r "{}" "$(dirname "{}")/$(basename "{}" .pack).jar"' \;`. – amichair Feb 27 '13 at 23:19
  • 9
    If you want the src.zip, then you should also "extrac32 110" in .rsrc/JAVA_CAB9, and copy that to the root of your resulting JDK directory. – Chris Noe Jul 17 '13 at 16:15
  • 45
    It appears that as of JDK 7u40, the exe file has tools.zip directly inside it, so you should skip the cab (111) steps and just extract tools.zip directly from the exe and continue from there. – amichair Nov 24 '13 at 14:22
  • 1
    This works, but as others mentioned, the exe has the tools.zip directly in there now. Maybe this is due to how 7zip extraction has changed. In any case, thanks for the loop to unpack the .pack files into jars. – Avindra Goolcharan Apr 08 '15 at 17:26
  • 3
    I didn't have an .rsrc folder, so what I did is run the unpack200 step on the C:\JDK folder itself and that worked. (JDK 8u65) – Molten Ice Jan 19 '16 at 11:49
  • 3
    @AlixLourme same is true for jdk-6u45-windows-x64, the file is in `.rsrc\1033\JAVA_CAB10` – Adam Burley Feb 11 '16 at 21:18
  • 2
    for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar" (this will convert all .pack files into .jar files) this is the only important step here thanks! – Pankaj Mar 06 '16 at 01:44
  • 1
    Here is [unpack-jdk-x64.bat](https://gist.github.com/grabantot/402a4acf63f81ba754b26e2dce1b16a3#file-unpack-jdk-x64-bat) to do all of the steps above. Don't forget to set 7z location at the top of the file. JDK will be unpacked to a folder named jdk, all temp files will be removed. – grabantot Apr 23 '17 at 15:32
  • For jdk-8u131-windows-x64, the 111 file is in (second archive) `jdk-8u131-windows-x64.exe/.rsrc/RCDATA/100/.rsrc/1033/JAVA_CAB10/111` – Alix Lourme May 11 '17 at 14:46
  • @AlixLourme I don't have an RCDATA directory in .rsrc after extracting the same file just now. – Hakanai May 31 '17 at 04:05
  • @Trejkaz: I have rechecked on `jdk-8u131-windows-x64.exe` file from [Oracle javase download](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html), I found `.rsrc/RCDATA` directory (with 7-Zip) – Alix Lourme May 31 '17 at 09:23
  • I downloaded that exact file today, and I get .rsrc/1033/JAVA_CAB10, with no RCDATA in the path. – Hakanai May 31 '17 at 10:05
  • 1
    @Trejkaz: For me `.rsrc/1033/JAVA_CAB10` is in a first `.rsrc\RCDATA\100` archive of `jdk-8u131-windows-x64.exe`: `>"C:\Program Files\7-Zip\7z.exe" x jdk-8u131-windows-x64.exe` displays `Extracting .rsrc\RCDATA\100` and after `>"C:\Program Files\7-Zip\7z.exe" x .rsrc\RCDATA\100` displays `Extracting .rsrc\1033\JAVA_CAB10\111` ... – Alix Lourme May 31 '17 at 12:22
  • Maybe a difference between Windows and macOS builds of 7-zip? o_O – Hakanai May 31 '17 at 23:08
  • I've update with a forked version of [unpack-jdk-x64.bat](https://gist.github.com/smaudet/2cab5c8188ff0c2ae3c00bdb9499b53f) contains default 7z path, and better directory handling. – smaudet Aug 02 '17 at 12:41
  • @Igor, .exe? **And what about for Mac?** – Pacerier Dec 09 '17 at 22:51
  • With recent JDK it is easier. You have to extract the "jdk-10.0.2_windows-x64_bin.exe" file which contain a tool.zip. Extract this one to have the portable JDK folder. – veben Aug 31 '18 at 11:54
  • The source files packaged in the installer can be found in `C:\JDK\.rsrc\1033\JAVA_CAB9`, cd into it and `extrac32 110` and copy the resulting `src.zip` to where you need it. – ratchet freak Feb 07 '19 at 16:05
  • There is no "tools" directory in C:\JDK\.rsrc\1033\JAVA_CAB10 after I unpacked tools.zip – user3002512 Sep 21 '20 at 14:05
  • @user3002512 that's because you didn't extract tools.zip into that `tools` folder. Create that folder and extract the tools.zip into it. – Henrique de Sousa Jun 11 '21 at 10:06
  • You can unzip [the binaries](https://github.com/adoptium/temurin8-binaries/releases/tag/jdk8u362-b09) e.g. `OpenJDK8U-jdk_x64_windows_hotspot_8u362b09.zip` to `jdk-1.8.0.362.b09/` and add that as your `JAVA_HOME` path in Windows. – Mr. Polywhirl Feb 02 '23 at 19:15
  • @Mr.Polywhirl If you want to use older Oracle JDK versions (not OpenJDK), they don't provide any Zip archives for Windows. This is why you have to use the above method to unpack the installer. – dimizuno May 27 '23 at 11:36
75
  • Create destination folder where you can RWX (e.g. C:\jdk8)
  • Download jdk exe from Oracle (e.g. jdk-8u72-windows-x64.exe)
  • Unzip the tools.zip found inside it into the destination folder
  • In cmd.exe, run:
    • cd C:\jdk8
    • for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar"

This solution works for JDK 8 too, without Admin rights.

dARKpRINCE
  • 1,538
  • 2
  • 13
  • 22
Marc T
  • 913
  • 6
  • 5
  • 1
    It worked for the 64-bit version on Windows 7 on the jdk-8u31-windows-x64. – digfish Jan 29 '15 at 11:23
  • This answer allowed me to unpack JDK 8 – user1445967 Jun 05 '15 at 19:46
  • @MarcT running java -version still points to the old jdk. How can upate java to points to the new jdk? – edmond Apr 30 '16 at 17:25
  • @edmond You need privilege to modify the windows path (probably admin). From shell you can define your own variable (won't change the direct call to java) and you need to use as prefix. Fortunately with Eclipse you can point to any jdk on your local fs. – Marc T May 03 '16 at 15:42
  • 1
    It seems 7-Zip unzipping JRE_xxx.exe file creates installerexe file, unzip it once more to the same folder. JDK_xxx.exe file creates tools.zip to be unzipped once more. – Whome Jun 04 '16 at 11:32
  • Small clarification: in order to extract tools.zip from exe file Far manager can be used. Its official distrib (also can be installed as a portable zip) already contains plugin arclite, which is able to extract from executable files. – Peter Jul 18 '16 at 08:18
  • 4
    Apparently Oracle changed the packaging with latest JDK8 updates (111, 112) and this trick does not work anymore :-( – Marc T Nov 11 '16 at 10:14
  • Well... worked for me on 8u121 (just downloaded and did it right now). For what is worth, I downloaded the 32bits (Windows x86) package. – acdcjunior Apr 05 '17 at 15:00
  • Well... It worked for jdk-9.0.4_windows-x64_bin.exe on Window 7 64 bit..Thanks – napster Mar 07 '18 at 10:23
  • This also works on latest Java 7 archive jdk-7u80-windows-x64.exe – Jose Luis Soto Posada Jun 09 '20 at 18:20
70

You can download a Java Portable from PortableApps.com. It will not change your system settings. You can put it on your USB stick.

UPD: for those who needs JDK there's an open-source project OpenJDK Portable

UPD2: there is also a JDK Portable (Oracle)

Some people might be interested in official Oracle production-ready open source build of JDK

Maksim Vi.
  • 9,107
  • 12
  • 59
  • 85
  • 44
    That's great, but it's only a JRE, not a JDK. – barfuin Jun 20 '12 at 19:54
  • 1
    @Vivien, if OpenJDK works for you there is OpenJDK Portable project - http://sourceforge.net/projects/openjdkportable/ – Maksim Vi. Sep 16 '14 at 18:48
  • For **Windows** OpenJDK Portable see http://stackoverflow.com/questions/5991508/openjdk-availability-for-windows-os – Pacerier Jul 23 '16 at 09:21
  • 4
    It would be better if it was provider by Oracle. – Mehdi Feb 16 '17 at 16:26
  • 2
    Update: [PortableApps now offers a portable version of the Java JDK.](https://portableapps.com/apps/utilities/jdkportable) – Stevoisiak Sep 05 '17 at 17:03
  • PortableApps 64 bit Java JDK (https://portableapps.com/apps/utilities/jdkportable64) is no longer downloadable. Link page comes up but actual download is no longer on the server. – JohnC Jan 29 '19 at 16:26
  • This one works perfectly: https://portapps.io/app/oracle-jdk-portable/ – nvbach91 Jul 29 '19 at 13:21
50

For JDK 8u102 things have changed, this worked for me:

  1. Download windows JDK exe
  2. Open with 7-Zip
  3. Dump contents into a directory %JDK-EXE%
  4. cmd: cd %JDK-EXE%.rsrc\1033\JAVA_CAB10
  5. cmd: extrac32 111
  6. Now have a tools.zip in directory, open it in 7-Zip
  7. Extract contents into a new directory %JDK-VERSION%
  8. cmd: cd %JDK-VERSION%
  9. cmd: for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar"
  10. src.zip is in %JDK-EXE%.rsrc\1033\JAVA_CAB9\110\ - put a copy into %JDK-VERSION%

Now you are ready to go. You might want to setup JAVA_HOME and PATH to point to your %JDK-VERSION% dir and its BIN subdir.

David Richmond
  • 501
  • 4
  • 4
29

Here is a good, but a little complex, way:

Stage 1: MSI & CAB from native installation file

  1. Download the JRE or JDK from the Oracle (Sun) website. This method will work on any version and on SDK or JRE.

  2. Run and wait for the installer to load. Minimize the window.

  3. In Windows 7, you should browse to this location:

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

  4. There, you will have a few MSI and CAB files.

enter image description here

Stage 2: easily extract the MSI & CAB using uniextract

  1. Browse to Universal Extractor | LegRoom.net and download UniExtract Binary Archive.

  2. Use WinRar or any un-RAR program available to you, and extract uniextract161_noinst.rar anywhere.

enter image description here

Stage 3: finally, extract the inner container named core.zip

  1. Drag & drop jdk1.6.0_31.msi or jre1.6.0_31.msi on the icon of UniExtract.exe.

  2. Select "Extract Method: MSI Administrative Installer". 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

  4. Follow all levels inside and you'll see core.zip. enter image description here

  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.

* You can now close the installer of Java you've left opened in stage 1 *

Cheran Shunmugavel
  • 8,319
  • 1
  • 33
  • 40
  • This doesn't seem to work for me I am trying to get 6.45x64 of Java under windows 7 I get a Internal Error 2203 any ideas? – Jackie Nov 18 '13 at 16:20
  • I think my problem was something to do with it being an online installer. I found an older (x86) version that was an offline installer and it seems to give me the core.zip – Jackie Nov 18 '13 at 16:27
  • Still can't seem to get it to work on JDK though... – Jackie Nov 18 '13 at 16:33
  • @Jackie you should use full (also known as 'offline') version. –  Jan 15 '14 at 10:59
  • For me core.zip seemed to be tools.zip For JDK 8 – Dessus Sep 06 '15 at 01:56
  • I can't find any msi or cab files.... – Stardust Jan 18 '16 at 22:15
  • Hey @Stardust you can also start the Java installer of your choice, no need to complete the installation or even click a button, the setup files (MSI) will be placed under your "temporary files" folder, which you can access by pressing [WINDOWS]+[R] -> paste: `%TEMP%` -> [ENTER]. keep in mind there are a lot of files there, sort them by date of modification, it can be either under the root or in a sub folder, once you've copied the MSI file(s), you can cancel the installation, so essentially nothing is written to your file-system, or registry, the only purpose of it is the extraction.. enjoy. –  Jan 19 '16 at 06:18
  • @EladKarako Does this require admin rights? I tried it and I couldn't find any MSI files. – Stardust Jan 22 '16 at 23:53
  • @Stardust probably.. –  Jan 23 '16 at 08:06
27

The answer has been given before. It works for "jdk-8u91-windows-x64.exe" also

  1. Unzip with 7-zip, so we get tools.zip
  2. Unzip tools.zip to a folder folder_name so we get the contents in the picture enter image description here

  3. In cmd move to the folder folder_name/bin and run the command

    java -version

the output will be

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

this indicates that there is something messing. Actually we need to unpack all packages.

  1. In cmd move to the folder folder_name and automatically do the unpacking by executing the command

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

  2. Do step 3 again, if you get the output bellow, then the JDK is ready to use.


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)
Bennett McElwee
  • 24,740
  • 6
  • 54
  • 63
Ahmad
  • 381
  • 3
  • 3
  • 1
    Awesome. You made my day. Worked like charm. This is precise answer for OP's question. Thanks a lot for detailed instructions :) – kaluva Jun 24 '16 at 09:49
  • This helped me a great deal - I just followed these steps to get a "portable" JRE 6u45 64-bit for testing old things. :) –  Aug 19 '16 at 06:17
  • Thanks man. It worked for "jdk-8u102-windows-i586.exe" also. – Ashrumochan Feb 25 '19 at 03:41
24

This is how I do it,

Start with the exe installation and wait for the below screen,

enter image description here

Go to the C:\Program Files (x86)\Java and copy your JDK to another place.

Cancel the installation by clicking 'x' and uninstall JDK.

Copy the copied JDK back into C:\Program Files (x86)\Java or other folder of your choice

Avinash Singh
  • 3,421
  • 2
  • 20
  • 21
  • 4
    Somehow people missed this gem. It works! – ramazan polat Dec 02 '16 at 06:22
  • Note to self: even after cancelling installation, i had to remove/uninstall it using Control Panel | Programs and Features. This solution should be higher in the list, it is quick, simple and works. – posix99 May 23 '18 at 06:09
  • 6
    Not useful when you don't have the administrator privileges on the machine – skvp May 28 '18 at 12:32
  • 1
    That is what I do. Install, copy, uninstall. I do not want Java interacting with my browser! Stupid that we have to jump through these hoops. And also always need to manually set JAVA_HOME. – Tuntable Jul 28 '20 at 01:09
8

The widely-upvoted answer is fine, I've used it for quite some time in the form of this bat file:

@ECHO OFF

SETLOCAL ENABLEDELAYEDEXPANSION

SET ROOT=%cd%

REM Get the tools.zip from the innards of the installer
7z e *.exe .rsrc/1033/JAVA_CAB10/111
7z e 111 7z x tools.zip
REM Extract all
7z x -aoa tools.zip -ojdk

del tools.zip
del 111

REM Searching directory structure from root for subfolders and zipfiles.
FOR /F "delims==" %%d IN ('dir /ogne /ad /b /s "%ROOT%"') DO (
    echo Descending into %%d
    FOR /F "delims==" %%f IN ('dir /b "%%d\*.pack"') DO (
        echo Extracting "%%d\%%f"
        REM Extract all packs into jars.
        jdk\bin\unpack200 -r  "%%d\%%f" "%%d\%%~nf.jar"
    )
)

ENDLOCAL
pause;

It requires access on the path to 7zip, and must be run in a folder alongside the JDK of your choice (it'll find it because of the *.exe up here).

Works on 8u144, and I guess it worked from the 8u20 thing.

Saucistophe
  • 314
  • 2
  • 10
7

Download JAVA SE with JDK

  1. Download jdk from Oracle website: http://www.oracle.com/technetwork/java/javase/downloads/index.html
  2. Unzip the exe. For example: jdk-8u5-windows-x64.exe
  3. Unzip the following file: tools.zip (found under the unzipped folder) to the desired JAVA_HOME.
  4. Update the JAVA_HOME environment variable to point to your desired path.

Tested for version: jdk-7u60-windows-x64.exe, jdk-7u60-windows-x64.exe

Download JAVA EE with JDK

  1. Download jdk from Oracle website: http://www.oracle.com/technetwork/java/javaee/downloads/index.html
  2. Unzip the exe. For example: jdk-7u55-windows-x64.exe
  3. Unzip the following file: Product\Packages\jdk.zip (found under the unzipped folder) to the desired JAVA_HOME.
  4. Update the JAVA_HOME environment variable to point to your desired path.

Tested for version: jdk-7u55-windows-x64.exe

Alin Stoian
  • 1,122
  • 1
  • 12
  • 24
  • With jdk-7u60, after I unzip (step 2) with 7zip, I only get tools.zip, no other files are extracted from the exe... :( – Sorin Postelnicu Jun 26 '14 at 16:09
  • Actually for me the same happens for jdk-7u55, for both x64 and x32... – Sorin Postelnicu Jun 26 '14 at 16:25
  • You are trying to download the Java SE Development Kit, not the Java EE Development Kit. For Java SE JDK, Just unzip the tools.zip file to a JAVA_HOME folder. See the updated instructions above. – Alin Stoian Jul 01 '14 at 16:19
  • 3
    i extracted tools.zip and set JAVA_HOME. After I am getting "java/lang/NoClassDefFoundError: java/lang/Object" while running `javac`. – arulraj.net Jan 27 '15 at 08:44
  • I extracted something like jdk, but intellij idea didn't recognize it as jdk home. – Yaroslav Feb 28 '15 at 20:58
  • 1
    @arulraj.net What i did was follow Igor guide (scroll up) after extracting executing the following command within the jdk folder as he specified `for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar"` – N.Schipper Jul 03 '15 at 22:52
  • @Schippie Thanks. I was followed this https://gist.github.com/helkhalfi/f7e35f5302b2be7e29b4 tutorial and solved the problem. – arulraj.net Jul 04 '15 at 03:06
7

There is a .tar.gz file of the Java Runtime Environment (JRE) on the Oracle website for these operations systems: Windows x86, Windows x64, Linux x86, Linux x64, Mac OS X x64, Solaris x64. See: http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

Also there is the Java Development Kit (JDK): http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html. The Windows .tar.gz. is missing, but you can just extract the .exe file with a tool like 7zip.

I found this is very useful to make Eclipse portable. ;-)

K B
  • 1,330
  • 1
  • 18
  • 30
  • 2
    JDK .tar.gz is missing for OSX too. – lucasvc Mar 15 '16 at 19:55
  • Unzipping the Windows .exe doesn't give you the files in the format you need (at least not as of 8u181). Other answers provide detailed steps on how to further extract the contents. – Rangi Keen Oct 03 '18 at 13:26
7

You can download a portable Zulu .zip archive from Azul Systems, which are builds of OpenJDK for Windows, Linux (RHEL, SUSE, Debian, Ubuntu, CentOS) and Mac OS X.

Zulu is a certified build of OpenJDK that is fully compliant with the Java SE standard. Zulu is 100% open source and freely downloadable. Now Java developers, system administrators and end users can enjoy the full benefits of open source Java with deployment flexibility and control over upgrade timing.

More technical information on different JVMs (including Zulu) with their architectures and OS support here.

Voicu
  • 16,921
  • 10
  • 60
  • 69
5

try this: http://maven.nuiton.org/nexus/content/repositories/jvm/com/oracle/jre/

this link contains portable zip distributions for all versions.

swapyonubuntu
  • 1,952
  • 3
  • 25
  • 34
4

Here is a link for JDK 5 zip file. sun-jdk-5-win32-x86-1.5.0.12.zip

zaki benz
  • 672
  • 7
  • 21
  • Saved the day for me, thanks a bunch! Side note: sourceforge.jp has a seriously ghetto download page. – nerdherd Jan 13 '14 at 19:37
4

Download the Processing application from http://www.processing.org/download/. The zip file contains a folder called java. It includes the JDK 1.6.0_32 (version checked on 19/02/2013).

Oliver Kocsis
  • 633
  • 1
  • 6
  • 12
4

OSX Instructions

Tested with jdk-8u74-macosx-x64.dmg.

  1. Download from Oracle the .dmg
  2. Mount the disk image
  3. Extract the .pkg, dragging it. Do not double-click (it will install).
  4. Open a terminal and cd into the package.
  5. mkdir jdk-$version && cd jdk-$version
  6. xar -xf ../JDK*.pkg
  7. cd jdkTAB
  8. tar zxf Payload
  9. The Contents/Home folder contains the JDK
lucasvc
  • 767
  • 1
  • 11
  • 35
  • This is indeed the best solution for mac! Just a note, to access the folder `Contents/Home` from Finder, rename the `jdk TAB` file (from step 7) to remove the `.pkg` extension and make it a Finder accessible folder – Slartibartfast Sep 11 '18 at 10:27
4

You can download SEVER JRE it contains jdk. server jre 7

  1. Download server-jre-< version>.tar.gz file for windows system.
  2. If you have 7zip tar file can be extracted by that, I used cygwin(cygwin can be installed without admin rights see this answer) to extract tar file with command tar xzvf file.tar.gz any other tar extractor will also work

Now extracted JDK folder will be created in same folder.

Community
  • 1
  • 1
priyanka_rao
  • 465
  • 1
  • 4
  • 20
  • 1
    Works even for jdk8 as well. You made my day. This is by far the easiest method. – kspviswa Jul 27 '16 at 17:29
  • +1. This works for Oracle JDK 7 downloaded from https://www.oracle.com/java/technologies/javase/javase7-archive-downloads.html. Download the server JRE. Untar it. Voila! – Zaki May 13 '22 at 07:15
3

The Sun JVM is available as a MSI which is executable from a script.

http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/install-msi.html

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
  • that's one step closer to what I'm looking for... – opensas Oct 25 '09 at 12:56
  • 1
    Switch to Ubuntu. "sudo apt-get sun-java6-sdk" ... (The very first time you have to accept a license). – Thorbjørn Ravn Andersen Oct 25 '09 at 14:27
  • 1
    I've already switched to ubuntu, and even there, I rather just download and untar from oracle than issuing apt-get, with just a symlink I can have many JDK installed side by side... – opensas Aug 17 '11 at 05:12
  • 1
    You cannot get the "download and unzip and run" functionality easily because you need to accept the license. I have, however, found that Jenkins can automatically download Java and make it available to itself. Perhaps you could lift that functionality for yourself? – Thorbjørn Ravn Andersen Aug 17 '11 at 05:23
  • This no longer works. The download link has been taken down. – mikeslattery Apr 24 '14 at 02:30
3
mkdir c:\JDK
cd c:\JDK
git clone https://bitbucket.org/ramazanpolat/jdk-8u112-windows-x64/

or

git clone https://bitbucket.org/ramazanpolat/jdk-8u112-windows-x86
ramazan polat
  • 7,111
  • 1
  • 48
  • 76
3

JDK's can be downloaded from here as zip file nor .exe http://installbuilder.bitrock.com/java/

supernova
  • 3,111
  • 4
  • 33
  • 30
2

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

Juancentro
  • 1,119
  • 7
  • 19
2

This link

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

helps you at least avoid the obnoxious preload installer getting straight to the SDK.

From there, I would install this in a throw-away VM, on your old crufty PC or elsewhere, then transfer the resulting

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. Of course, also w/o the security from frequent automatic updates.

Frank N
  • 9,625
  • 4
  • 80
  • 110
  • 1
    Also without browser plugins so applets and javafx are not going to work, webstart is not available, the jar type is not bound to javaw.exe and no "default java" is installed at all. But if you don't need any of that, of course this is just fine. – Gimby Jan 04 '13 at 12:26
  • Yep, I couldn't agree more :-) That's what the OP "no installer" asked for. Of course, someone (certainly not from sun-oracle) could analyse what happens to the registry during a regular install and provide a number of .reg(istry) files on a take-it-or-leave-it basis. As we know, many browsers disabled any and all java-plugins. For good reasons. I am glad, they did. – Frank N Aug 16 '13 at 09:35
2

I discovered you can run the installer in 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/

This should work for jdk as well

Jules
  • 14,200
  • 13
  • 56
  • 101
Jason Pell
  • 41
  • 4
2

Thanks for asking; the JDK does not seem to interact with the Windows registry.

However, the JRE does in certain instances.

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

iokevins
  • 1,427
  • 2
  • 19
  • 29
  • 1
    well it certainly does now. i have not been able to re-install jdk6 due to the registry config being broken and it insisting on a reinstall which never works – Steven Feb 03 '11 at 12:21
  • well, that's the sort of things I'm trying to avoid... – opensas Aug 17 '11 at 05:13
2

The Process described by Igor and CharlesB Works to me, since IDE's like NetBeans and Eclipse permit specify the location of the JDK, even software like Apache Tomcat (the ZIP Distribution) use BASH - FILES to set it up (then specify the JDK location using relatives URI).
I Have a USB-HardDisk With NetBeans, Eclipse, Apache Tomcat working with a JDK in "portable mode".
I Had a way to extract a copy of the JDK from the installers files: Install it, Copy it in other place and then uninstall it. A dirty way to extract it, but was successfull.
The place to put EXTRA - LIBS was: %PLACE_WHERE_JDK_ARE%\jre\lib\ext

1

I did copy the JRE folder several times and it always works fine. But I am really not sure if you can just get a zip file with its contents, as the official installation install the plugins for IE, Firefox and whatsoever.

Ravi Wallau
  • 10,416
  • 2
  • 25
  • 34
  • well, I have a zip file uploaded to dropbox, I download it and copy to every machine... it worked fine so far... – opensas Nov 17 '10 at 04:21
1

http://androidhost.org/D8wsv

You can get jre-7u75-windows-i586.zip from the link above.

helper
  • 11
  • 1
1

Commands from tips below wrapped as batch script. Save this as unpack.bat. Then place it to dir with jdk/jre extracted files.

@echo off

cd /d "%~dp0"
for /r %%x in (*.pack) do .\bin\unpack200 -r "%%x" "%%~dx%%~px%%~nx.jar"
yuliskov
  • 1,379
  • 15
  • 16
0

I installed JDK 8 with the exe installer and then uninstalled JRE, I now have JDK folder with no env variable or other setting changed.

ankit.ag.in
  • 161
  • 1
  • 2
  • 7
0

http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

Here's where. Download the .gz package.

Suvadeep
  • 9
  • 1
  • Can you explain a bit more? – Dieter Meemken Apr 14 '16 at 11:01
  • The OP specifically asked for how to download a .zip, but this solution specifically suggests downloading a .gz (slightly different), which is not extractable on a native (only built-in utilities) Windows machine. – shawmanz32na Sep 21 '18 at 01:31
0

Install in sandbox, and copy the folder out.

BaiJiFeiLong
  • 3,716
  • 1
  • 30
  • 28