Before going ahead make sure you have installed java if not follow How To Install Java Development Kit 11 on Debian 10
In the above following article stop at Set Environment Variables
- copy the below code at the end of config.fish
## java 11 jdk
set --export JAVA_HOME (dirname (dirname (readlink -f (which java))))
set -gx PATH $JAVA_HOME $PATH
- Save the changes and exit your text editor.
- Verify that the JAVA_HOME and PATH variables were set correctly:
echo $JAVA_HOME
echo $PATH
The JAVA_HOME variable should be set to the directory that contains your OpenJDK installation, and the PATH variable should include the directory that contains the OpenJDK binary files.
And continue here Test the Java Installation (Optional)