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?
JAVA_HOMEandJAVA_HOME/binto thePATHvariable