Installing JDK without administrator privileges

前端 未结 14 1669
旧时难觅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:50

    I have tried several ways of installation, but there is a common problem:

    In the worst case, if any installation requires admin privilege, then you will not be able to use 7zip because there is no portable version of 7zip. But, in Windows 10 and later versions of Windows 7(if my memory serves me well), extracting zip file is possible without any program installation: just open the .zip file with "Windows explorer" and extract them. However, this only works a normal zip file, not with JDK installer.

    So, I have tried another way and it works(for oracle jdk 1.8-191): you can install a JDK in other PC where you have privilege, pass it to your company PC, and set it as the JDK to use.

    1. just intall the JDK in another PC where you have admin privilege, such as that you have at home
    2. Zip that JAVA_HOME folder(the parent folder of bin), copy it to a USB driver, and take that to your company.
    3. Unzip in a folder where you have full access, like C:\Users\\java(because some company also restrict pasting into Program Files or somewhere else, but will never restrict what you do in your personal user folder
    4. Set JAVA_HOME variable to there(if you are not allowed to do that, just skip). The same applies to setting up the java path(adding bin\java to PATH variable)
    5. Open Intellij IDEA or Eclipse, setup your new JDK in the IDE to point to there.
    6. Write a simple Hello World program to verify.

    I found this because when I look into the JDK installer, I see very similar structure as in JDK folder. So I suspect the installation only consists of extracting the content into a foler, plus some config, which we can do manually. Looks like that my theory is proved.

提交回复
热议问题