javac does not work in ubuntu terminal

后端 未结 6 1065
后悔当初
后悔当初 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:21

    As mentioned by @Blorgbeard you most likely do not have a Java JDK (Java Development Kit) installed. See this web page for more information about the various versions of Java available for Ubuntu.

    The following command will install the OpenJDK version of the Java JDK:

    apt-get install default-jdk
    

提交回复
热议问题