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

5

1

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?

Vijay Shanker Dubey

Posted 2011-09-09T06:50:53.370

Reputation: 239

@home: Correct. See http://www.heraly.be/wiki/doku.php?id=java:setupportablejava for proof that it works.

– unforgettableidSupportsMonica – 2015-01-15T02:44:49.527

2My two penneth as a sys admin. If it's a controlled environment then that's for a reason. Installing SW introduces risks and unknown incompatibility issues. Speak to your IT department, we genuinely aren't there to just say no. We want to help users the best we can. Not to mention installing SW is probably against the IT policies and could get you in hot water with your boss – Joe Taylor – 2015-03-31T10:22:15.817

@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. – unforgettableidSupportsMonica – 2015-10-08T17:18:21.753

@JoeTaylor: As for me, I share a (home) laptop with others and want to install a JDK in my account and my account only. – unforgettableidSupportsMonica – 2015-10-08T17:31:26.050

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. – unforgettableidSupportsMonica – 2015-10-08T22:39:51.333

@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 – pun – 2015-10-09T00:02:27.170

6I 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... – home – 2011-09-09T06:58:52.850

Answers

2

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.

EddieBytes

Posted 2011-09-09T06:50:53.370

Reputation: 121

and for install these installer you need admin rights. It is not seems a solution. – user710818 – 2013-05-29T07:43:52.660

1

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.

Wolfe

Posted 2011-09-09T06:50:53.370

Reputation: 11

1I 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 – Peter Hofman – 2014-01-23T11:28:33.910

1

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%
)

Davis Molinari

Posted 2011-09-09T06:50:53.370

Reputation: 21

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.

– slhck – 2015-03-31T12:47:49.323

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). – Davis Molinari – 2015-04-01T08:46:56.893

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. – slhck – 2015-04-01T09:11:02.183

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

– unforgettableidSupportsMonica – 2015-10-08T23:28:34.303

1

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.

unforgettableidSupportsMonica

Posted 2011-09-09T06:50:53.370

Reputation: 983

0

  1. Download SEVER JRE it contains jdk. server jre 7
  2. Download server-jre-.tar.gz file for windows system.
  3. 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.

priyanka_rao

Posted 2011-09-09T06:50:53.370

Reputation: 101

0

weberjn

Posted 2011-09-09T06:50:53.370

Reputation: 325