javainstallationlimited-user

Installing JDK without administrator privileges


I am trying to install JDK at office laptop but it says I need administrator privileges. I have only access to my own account at work.

How can I install the Java Development Kit without administrator rights?


Solution

  • Here is a workaround to install java without admin privileges or without administrator password. For this you need cygwin installed which does not require admin privileges. In the utils make sure you select cabextract.exe to install it.

    Fireup cygwin bash shell.

    Type cabextract jdk1.6.exe <-- jdk file name

    this will extract all the files into the current directory.

    Move tools.zip to a new directory and unzip it using cygwin or windows explorer. This will be your java directory.

    Hint: Try to subsitite 7zip instead of cabextract and cygwin. If it works it will be much faster.

    Edit: This doesn't get you a working JDK with the latest versions of jdk 6 and 7. Many of the jar files (eg rt.jar) are compressed so they need to be decompressed using unpack200.

    Just go through each directory looking for files with a .pack extension and unpack them using unpack200, eg: .\jre\bin\unpack200 .\jre\lib\rt.pack .\jre\lib\rt.jar

    This allows you to run java programs however I still had trouble with Eclipse as there was some issue with annotations, so there's probably another step that is missing.

    In the answers to this similar question on Superuser is available a script that automatically finds all .pack files and unpacks them in the right folders.