javac does not work in ubuntu terminal

后端 未结 6 1045
后悔当初
后悔当初 2021-02-06 23:41

When I try to compile a java program with javac, I get an error:

The program \'javac\' can be found in the following packages:
 * default-jdk
 * ecj         


        
6条回答
  •  醉梦人生
    2021-02-07 00:24

    I was having the same problem. I used the following command

    sudo apt-get install openjdk-7-jdk

    The app compiled after that. Not sure what the difference is to the above solutions. Maybe I wouldn't of had to specify a version.

提交回复
热议问题