I am trying to run bluej using command terminal but I get this : A suitable Jdk couldn't be located. You may need to edit the /usr/bin/bluej launch script
Please help i am new to this.
I am trying to run bluej using command terminal but I get this : A suitable Jdk couldn't be located. You may need to edit the /usr/bin/bluej launch script
Please help i am new to this.
first remove blueJ
sudo apt remove bluej
Install openjdk-8
sudo apt-get openjdk-8-jdk
Then Install Bluej .deb file
sudo dpkg -i *.deb
It will be work
If you haven't installed a JDK, you have several options.
You may install one via apt-get, for that, open a terminal and type:
sudo apt-get openjdk-8-jdk
I recommend this, as it will set everything for you properly and you will be able to upgrade easily.
You can also install Oracle's JDK vida the WebUpd8 PPA as detailed here, I believe it will also take care of everything for you.
Finally, you can install Oracle's JDK, but you will need to set set your JAVA_HOME, PATH and alternatives manually.
JAVA_HOME is used by some applications to find your JDK. I'm unsure if BlueJ uses it.
PATH is used by your shell session to know where it can look for any executables.
If you have several JDK versions, lets say you have the OpenJDK from the official Ubuntu repos, plus Oracle's JDK 1.8., both in your PATH. If you call javac, The Debian alternatives system will be used to resolve which one of those javac binaries will be used.
To do this, append this lines to your ~/.bashrc:
export JAVA_HOME=/path/to/jdk export PATH=$PATH:$JAVA_HOME/bin
Source your bashrc file ( . ~/.bashrc ). Afterwards, update your alternatives (you will only need to do so if you have more than one JDK installed).
--install E.g. sudo update-alternatives --install /usr/bin/javac javac $JAVA_HOME/bin/javac 1 --set E.g. sudo update-alternatives --set javac $JAVA_HOME/bin/javac
To help you identify which alternatives you may need to update you can use:
update-alternatives --get-selections | grep java
If you really need to edit the launcher, you can edit /usr/share/applications/bluej.desktop:
sudo nano /usr/share/applications/bluej.desktop
or add your own at
~/.local/share/applications/bluej.desktop
But I doubt that is the issue.
/usr/lib/jvm
then I resinstalled it using sudo apt-get install oracle-java8-installer
and it worked well!! Thank you everyone for your help :)
– Roy
Feb 23 '17 at 11:59
My problem has been sorted. I accidently deleted /usr/lib/jvm
then I reinstalled it using:
sudo apt-get install oracle-java8-installer
and it worked well!! Thank you everyone for your help :)
echo $PATH | grep java
orecho $PATH | grep jdk
return any thing ? – George Udosen Feb 17 '17 at 18:58JAVA_HOME
any improvements ? – George Udosen Feb 18 '17 at 03:14