Here is a simple way to configure Java in Ubunu Linux. After following these steps, commands like java and javac will be available in the terminal window.
- Download the JDK and unpack it somewhere on your system. Let’s use /home/user/bin as an example.
- Set the file you download to executable. You can do this by right-clicking the file, choose Properties->Permissions.
- Excecute the file by double-clicking it and choose “Run in terminal” . Say yes a few times and you’re done.
Now you need to make Java available in the path so you can use it from any terminal.
- Edit the file .bashrc under your home directory and add the following lines
- Open a new terminal window and type java -version to make sure you’re running the java version you expected. Type env and verify that PATH variable contains the path to the JDK that you exported before.