Installing JDK without administrator privileges

前端 未结 14 1692
旧时难觅i
旧时难觅i 2020-12-13 00:13

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

14条回答
  •  青春惊慌失措
    2020-12-13 00:41

    In order to easily install Java JDK on Windows without administrator privileges, you can use https://aws.amazon.com/corretto/. It contains a portable amazon-corretto--windows-x64-jdk.zip file, that you just need to download and unzip.

    1. Download the portable zip file from amazon.com, e.g. https://d3pxv6yz143wms.cloudfront.net/8.232.09.1/amazon-corretto-8.232.09.1-windows-x64-jdk.zip

    2. Unzip it in a folder, e.g. C:\Users\John\programs

    3. Set the JAVA_HOME variable, e.g. set JAVA_HOME=C:\Users\John\programs\jdk1.8.0_232

    4. Add the path to the "bin" folder to the PATH: e.g. set PATH = %PATH%; %JAVA_HOME%\bin

    5. Test if the installation works with javac -version

    Remark #1. I am proposing this alternative technique using Amazon Corretto because other proposed answers requires 7-zip for which you need administrative rights to install, and I did not find a simple portable .zip version of 7-zip.

    Remark #2. You can set up your environment by having a my-cmd.cmd file which contains the needed variables:

    rem # PROMPT is an optional question of taste ;-)
    prompt [$P]$_$$$S
    rem # VARIABLE(S)
    set JAVA_HOME=C:\Users\UW31RY\programs\jdk1.8.0_232
    rem # PATH
    set PATH=C:\WINDOWS;C:\WINDOWS\system32;%JAVA_HOME%\bin
    rem # Clear the screen!
    cls
    

    and creating a shortcut with %windir%\system32\cmd.exe /K "my-cmd.cmd" as Target: value, and the folder which contains the my-cmd.cmd file as Start in: value, e.g. C:\Users\John\work.

提交回复
热议问题