Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Java manually on Windows? [duplicate]

I have seen many products bundeled with JDK, I wonder if there is a way where one can install JDK by simply unzipping contents to a directory, so there is no icon created in add/remove programs, no registry entries etc.

Also in this case: How can we configure Java plugin for browsers? And how can we configure settings as seen via Control Panel entry for Java?

like image 339
sachin Avatar asked May 30 '09 18:05

sachin


People also ask

Can I copy the JDK installation folder?

yes you can copy the installation directory, only change you need to do is to change you JAVA_HOME and PATH variable accordingly...

Can you download Java twice?

You can download multiple versions of the JDK at: Java SE downloads (version 15, version 11, and version 8 are currently available).

How do I reinstall Java on Windows?

Click the Windows Start Button and select Settings then Control Panel. Click Windows Update in the Control Panel list. Next, to install Java go to the Java website: http://www.java.com/en/download/manual.jsp. Click to download the appropriate version for your Windows operating system.


2 Answers

According to this, I created a batch script to build jdk archives automatically.

The essential parts of the link are:

  • Create working JDK directory ("C:\JDK" in this case)
  • Download latest version of JDK from oracle (for example "jdk-7u7-windows-i586.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-[6-7]u?-windows-i586.exe" in directory "C:\JDK"
  • In command shell (cmd.exe) do the following:
    1. change directory to directory C:\JDK.rsrc\JAVA_CAB10
    2. execute command: extrac32 111
  • Unpack C:\JDK.rsrc\JAVA_CAB10\tools.zip with 7-zip
  • In command shell (cmd.exe) do the following:
    1. change directory to C:\JDK.rsrc\JAVA_CAB10\tools\
    2. execute command: for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar" (this will convert all pack files into jar)
  • Copy whole directory and all subdir of c:\JDK.rsrc\JAVA_CAB10\tools" where you want your JDK to be and setup manually JAVA_HOME and PATH to point to your JDK dir and its BIN subdir.
like image 177
Edison Avatar answered Sep 23 '22 15:09

Edison


Yes, you can create a zipped up JDK, unzip it on the target machine and run java, javac, etc. from that directory to your heart's content.

The easiest way to create such a zip file is to install the JDK on a machine and then zip up the contents of the JDK directory. We do this in certain circumstances where we need to control exactly what configuration of Java will be used in our deployments. In that case, our scripts just point JAVA_HOME (or the equivalent) to our internally bundled JDK instead of relying on a sysadmin to install exactly what we need prior to arrival.

In terms of integrating with the browsers, that can be a bit more problematic. The short answer is no, you can't integrate directly with the browser without some sort of installer.

like image 32
Bob Cross Avatar answered Sep 21 '22 15:09

Bob Cross