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 Dev
Here are all the steps that got the JDK installed on Windows 7 without admin rights.
You need the cabextract program to extract the installer files. I tried 7zip but it didn't extract the cab properly. Instead, I used cygwin. You can get the setup.exe program from their website, but you must rename it because Windows assumes that anything called "setup" requires admin rights. I renamed it to cygwin.exe. Run that. It'll ask you where to install. I chose the cygwin directory in my home directory. When the pop-up asks you which programs to install, type "cabinstall" in the search bar. Expand the "Archive" section and make sure the "cabinstall" is not set to "skip". (Click the "skip" text until the highest number shows.) Proceed with install. This takes a few minutes.
Optional: Add cygwin\bin to your path. Do this from control panel, user accounts, change my environment variables, edit PATH.
Download the JDK. I downloaded jdk-6u45-windows-x64.exe.
In the directory where that file is: mkdir tmp
cd tmp
cabextract ..\jdk-6u45-windows-x64.exe
Make a new directory for the actual JDK. I used jdk in my home directory.
Extract the tools.zip file into that. It comes with the Java runtime, so you don't need the other files in the original cab, such as jre.msi.
Unpack all the .pack files. You can do that manually by running the bin/unpack200 program on them, or use bash (if you installed cygwin above):
bash
for f in $(../cygwin/bin/find . -name "*.pack"); do bin/unpack200 $f ${f%.*}.jar; done
Add jdk/bin to your PATH (see step 2 above).