0

I want to install OpennJDK 1.8 in a Centos machine, which cannot be connected to internet. I am trying to download the file in another machine and copy to this machine. I am not able to find an option to download the OpenJDK 1.8 from anywhere. I am trying https://jdk.java.net/ which do not have this version.

Is there any way to download the OpenJDK 1.8 versions and install

1
  • Simply setting the JAVA_HOME and JAVA_HOME/bin to the PATH variable Commented Dec 19, 2019 at 23:22

1 Answer 1

1

CentOS uses yum to download/install/update packages. On box1 with Internet downloading only openjdk-1.8 rpm package:

yum install --downloadonly --downloaddir=<dir_to_place_rpms> java-1.8.0-openjdk 

After take the downloaded file and copy to box2. And on the box2 now:

yum install java-1.8.0-openjdk* 

It will require some dependencies packages, you will need to download, copy and install them together with openjdk too:

yum install java-1.8.0-openjdk* dependency-packages-1.rpm dependency-packages-2.rpm ... 

--

Updating answering the question.

The first command "yum install --downloadonly ..." is to be executed on the box with access to the Internet, what it does - it downloads the package "java-1.8.0-openjdk-VERSION.rpm" to the specified using "--downloaddir=" parameter directory. After the package file is downloaded, you need to take the file and copy it to the box without Internet, and after install it there, using "yum install java-1.8.0-openjdk*" command.

So what I described - it is the way to download the package on one computer with access to the Internet and install it on another (I suppose you have the same CentOS versions installed on both servers).

The problem is that some packages may require other packages in order to be installed, the list of required packages is different based on what you have installed on your server (you can check "yum deplist PACKAGE" command to get more info about dependencies).

So, for all that packages needed by java-1.8.0-openjdk (you will get info about missing packages when you try to install a package), you will need to perform the same procedure - download on one server, copy to another and install it there... some dependencies may have other dependencies, so it may be multi-step procedure.

Does it make sense?

1
  • thanks for the update, as I mentioned, the second box cannot connect to internet or download. Is there a single file or any links that I can use to download every file that is required? Commented Dec 19, 2019 at 16:38

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.