简体   繁体   中英

I want to install Java through the command line but I don't have sudo access.

This is what I have already done:

prompt> wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u60-b19/jdk-7u60-linux-i586.tar.gz"

Then untar it:

prompt> tar xzf jdk-7u60-linux-i586.tar.gz?AuthParam=1404311550_7de85e3ec1ae4acea63f229d9bf50dbell

Rename it:

prompt> mv jdk-7u60-linux-i586.tar.gz?AuthParam=1404311550_7de85e3ec1ae4acea63f229d9bf50dbe jdk-7u60-linux-i586.tar.gz

How to I finish the install without sudo access?

You don't really have to install it. You should be able to navigate into [your jdk folder]/bin and run ./javac -version.

So just add the bin folder to your path and set $JAVA_HOME and you're good to go.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM