Install Java on Ubuntu Server on xfce4 interface?

ar
- in Servers
11

I'm supposed to play a bit with Linux server for my training and I just thought about installing a Minecraft server on the server. I need java for that. I can't handle that somehow.

I've already tried that: https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04

Pa

At what point does your attempt fail and what error message will be output?

You also use Ubuntu 16.04?

ar

Is actually enough?

pa

Install Java:

apt install openjdk-11-jre

Set JAVA_HOME:

echo "export JAVA_HOME =" $ (readlink -f / usr / bin / java | sed 's: bin / java::') ""> /etc/profile.d/openjdk.sh

Run both commands as root.

ar

Get the following error messages:

E: Could not open lock file "" - open (13: Permission denied)

although I'm logged in with the only admin user and actually have the rights

ar

Ok, java has now installed differently

Pa

Do you still have a different package management tool somewhere, e.g. Synaptics, run? Then do that and then the steps again.

pa

You are only root when id -u 0 comes out.

ar

Have java now installed like this:

sudo apt-get install default-jre

and btw, how can I actually uninstall programs?

Pa

Sudo apt remove $ PACKAGE (keeps the configuration files) or

sudo apt purge $ PACKAGE (also removes the config files)

ar

Thanks

Pe

Install Java on Ubuntu Server on xfce4 interface?

That's the first mistake, on a server you do not need a graphical interface. The only opens additional entrance gates and brings no benefit.

I should play around for my education a bit with Linux server

A server is not a toy and if you want to learn this should not be public.

I've already tried that

At which point, so with which command do you not get further?

Linux Hase