0

I have downloaded and installed JDK 9 with NetBeans. NetBeans runs fine and I build test application that also runs fine from IDE. But if I run java command in terminal I have error

'java' can not be found in the following package:
...

So, where is my java? Should I download JRE separately?

Command

sudo update-alternatives --config java

gives

update-alternatives: error: no alternatives for java
vico
  • 4,717
  • 23
  • 66
  • 89

1 Answers1

0

Edit your .bashrc file by

gedit .bashrc

Add these line at the last of the file

JAVA_HOME=/usr/lib/jvm/jdk1.7.0 

(this path may change according to your system)

(this you copy as it is)

PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH

then logout and login

aman5319
  • 239
  • 1
  • 9