[Question] Is there a correct way to install Java in Clear Linux?

the java command doesnt work because when you extract it, it extracts in its own folder, and /usr/local/jre1.8-1.8.0_311/bin is not in $PATH.

To fix, either execute the following:

export PATH="$PATH:/usr/local/jre1.8-1.8.0_311/bin" 
echo 'export PATH="$PATH:/usr/local/jre1.8-1.8.0_311/bin"' >> ~/.bashrc

or the following:

sudo mkdir -p /usr/local/bin /usr/local/lib /usr/local/man
sudo mv /usr/local/jre1.8-1.8.0_311/bin/* /usr/local/bin/
sudo mv /usr/local/jre1.8-1.8.0_311/lib/* /usr/local/lib/
sudo mv /usr/local/jre1.8-1.8.0_311/man/* /usr/local/man/

i believe your rpm installation should work, as all of the listed dependencies are basic unix commands which are built in to the default clear linux installation and are difficult to remove.

1 Like