How can I install the Java Development Kit (JDK) on a Windows machine if I don't have admin rights?

28,807

Solution 1

You can install it in a per-user location, and place the path to JDK in the Path environment variable. You could use a setup authoring tool like Advanced Installer or InstallShield, of free tools like WiX or NSIS.

That should make it accessible to other apps searching for the JDK tools. Not the best way, but can't see any other choice in lack of admin privileges.

Solution 2

Maybe not so good idea, but you can try to download Processing, it is a Java covered programming language as it contains a portable version of Java JDK. You can erase everything except Java an use it.

Solution 3

I know this is a late answer, but here goes.

Unofficial OpenJDK 7 installers

Alex Kasko maintains unofficial OpenJDK 7 installers for Windows, Linux, and Mac OS X. You can download them here.

He writes:

With default settings installers do not require administrator privileges.

Note that you can no longer get security updates for the JRE 7 unless you pay Oracle for a support contract. Even if you use OpenJDK 7, you should probably not use the JRE 7: it's rather old. You should probably always use the newest JRE instead, for security reasons.

Unofficial OpenJDK 8 builds

I don't know whether or not Alex has built any unofficial OpenJDK 8 builds or not. But GitHub user "codespotx" definitely has. Please see here.

But, a warning

Maybe you shouldn't install any of the software I've linked to, after all. Please see this link for more details.

Solution 4

You can download the JDK and extract it. You will find a tools.zip file that you need to extract in a folder under the user path. Then you have to locate all the .pack files (they are in \lib and \jre\lib folders) and unpack them in the same folders with the unpack200 command, available itself in the \jre\bin folder.

I created a script to do this that just asks you the folder where you unzipped tools.zip and then it executes all the necessary commands.

Here you can find the whole procedure and the script:

echo off
REM Author: Molinari Davis - www.davismol.net
REM Version: 0.1
REM Date: 29/08/2014

if "%1"=="/processFile" goto processFile
SET /P commandPath=Insert the jdk folder path: 
SET commandName=\jre\bin\unpack200.exe
FORFILES /p %commandPath% /s /m *.pack /c "cmd /c call "%~f0" /processFile @path"
goto :EOF
:processFile
SET outputName=%2
SET outputName=%outputName:pack=jar%
SET fullCommand=%commandPath%%commandName% %2 %outputName%
REM echo %fullCommand%
%fullCommand%
if %ERRORLEVEL% GEQ 1 (
    echo ERROR in extraction of file: %outputName%
) else (
    echo Extracted file: %outputName%
)
Share:
28,807

Related videos on Youtube

Vijay Shanker Dubey
Author by

Vijay Shanker Dubey

An avid reader and learner of Software Architecture. Entrepreneur at heart, Software Architect in Making Currently a Principal Software Engineer at Oracle India, Bengaluru(India). A Sun Cetified Java Programmer. Sites: Twitter Updates Blogs Send Queries at - [email protected]

Updated on September 18, 2022

Comments

  • Vijay Shanker Dubey
    Vijay Shanker Dubey almost 2 years

    I'm currently working in a controlled environment where I don't have administrator rights. I am looking for some way to install the Java Development Kit (JDK) on this machine anyway.

    Is this possible? If so, how?

    • Admin
      Admin almost 13 years
      I don't think so. A workaround is to install the JDK on a machine you have full control of. Then copy the whole directory to the controlled machine, I've never seen a JDK that really requires any registry keys...
    • Admin
      Admin over 9 years
      @home: Correct. See heraly.be/wiki/doku.php?id=java:setupportablejava for proof that it works.
    • Admin
      Admin over 8 years
      @JoeTaylor: Interesting points which I hadn't considered. Still, in some places, a software installation request can take a month or more to be fulfilled. It can make it frustrating to get work done. No wonder that more and more workers nowadays bring a personal laptop to work.
    • Admin
      Admin over 8 years
      @JoeTaylor: As for me, I share a (home) laptop with others and want to install a JDK in my account and my account only.
    • Admin
      Admin over 8 years
      Dear OP: 1. Why didn't you have admin rights? 2. Why didn't the sysadmin install the JDK for you? 3. Perhaps you could have created a VM on the machine, and installed the JDK into the VM. 4. Really, you could have used a Windows equivalent of the Unix fakeroot tool. This is a tool which lies to applications and makes them think that they are running as the local administrator when they are, in fact, not. I don't know whether or not a Windows equivalent of fakeroot exists. You can ask a separate question if you'd like.
    • Admin
      Admin over 8 years
      @Vijay Shanker, I second Joe Taylor. IT owns the asset & infrastructure you are trying to manipulate & you could really get in trouble for doing something like this
  • user710818
    user710818 about 11 years
    and for install these installer you need admin rights. It is not seems a solution.
  • Peter Hofman
    Peter Hofman over 10 years
    I was looking for a way to install a JDK without an installer, so your suggestion looked promising. Are you sure it is a Java JDK? I don seem to be able to find javac.exe
  • slhck
    slhck about 9 years
    Hi Davis. Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Especially with links to your own website, we tend to flag this as spam. Please rather post the actual answer here.
  • Davis Molinari
    Davis Molinari about 9 years
    Hi and thank you for reply, even I didn't understand downvotes. I provided the solution to the question in my reply (download the file, unzip tools.zip, locate the .pack files and unpack them with the unpack200 command). Then I added a link (yes, it's to my own blog, because I wrote a post on this topic time ago) just to provide an enhancement to the solution and to put at disposal of everybody the script to automate the process and to avoid to do everything manually. If you consider the link as spam just delete it, but the solution still remains valid (and script it's just something more).
  • slhck
    slhck about 9 years
    I know, that's why I did not delete the post. I edited it to include the script, since we've seen lots of links go down over the course of several years. In that case, the essential solution is still available here. +1 from me, too. The "spam" rule only applies to users repeatedly posting links to their own blog instead of providing solutions on our site. It's not the case with you, so you're fine.
  • unforgettableidSupportsMonica
    unforgettableidSupportsMonica over 8 years
    @slhck: You can use the "Save Page Now" tool in the bottom-right corner of the Wayback Machine homepage to save a copy of any webpage for posterity.