Geany doesn't find javac

7,956

Solution 1

To fix this, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo apt-get install openjdk-7-jdk

Solution 2

Try fixing the issue by installing Oracle JDK 8. And try to find the correct version for the time being. Before this remove the Default Open-JDK-"version"(your Version) And try this code:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
Share:
7,956

Related videos on Youtube

Joel DeWitt
Author by

Joel DeWitt

For your consideration: I am a physicist. I like to calculate things. It's fun to have fun.

Updated on September 18, 2022

Comments

  • Joel DeWitt
    Joel DeWitt over 1 year

    I'm attempting to compile a Java program using Geany. I get /bin/sh: 1: javac: not found in the Compiler window. The available help out there suggests to make sure you have OpenJDK installed, which I do (6 & 7). Poking around, I find javac in /usr/share/bash-completion/completions. (I'm hesitant to start messing around with Java on Ubuntu since it seems to be so tempermental.) How do I point Geany to my Java installation? Any suggestions will be appreciated.

    • steeldriver
      steeldriver almost 10 years
      what are the outputs of which javac and update-alternatives --list javac?
    • Joel DeWitt
      Joel DeWitt almost 10 years
      which javac returns nothing; update-alternatives --list javac returns update-alternatives: error: no alternatives for javac
  • muru
    muru over 3 years
    You can suggest an edit, if all this is a version change: askubuntu.com/posts/510983/edit