Ustaw java_home na stałe ubuntu
sudo gedit /etc/profile
#add following lines
JAVA_HOME=/usr/lib/jvm/{your jdk path}
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
#logout to update the changes
Glorious Goat