Ask Your Question
0

javac don't found!!!

asked 2019-01-12 19:33:31 -0500

rigbyk3 gravatar image

updated 2019-01-12 19:35:30 -0500

Hi, need compile java code, but when run

javac Example.java

the terminal shows:

bash: javac: command not found

use:

[root@localhost C01]# alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
 + 1           java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.1.13-10.fc29.x86_64/bin/java)
*  2           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-11.fc29.x86_64/jre/bin/java)
   3           java-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.1.13-11.rolling.fc29.x86_64/bin/java)
Enter to keep the current selection[+], or type selection number: 1

Just select 1, because the book I use say JDK 11, works "java" command but not "javac", please help!!!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-01-13 00:26:36 -0500

villykruse gravatar image

The java compiler is provided by these packages:

java-1.8.0-openjdk-devel
java-11-openjdk-devel
java-openjdk-devel
edit flag offensive delete link more

Comments

Hi, unbelievable in https://apps.fedoraproject.org/packag... it's assumed that include devel packages, but not!, this is horrible.

rigbyk3 gravatar imagerigbyk3 ( 2019-01-13 13:10:17 -0500 )edit

It says "OpenJDK Runtime Environment 11". That is, not for compiling.

By the way, you may also want

java-1.8.0-openjdk-src.x86_64
java-11-openjdk-src.x86_64
java-openjdk-src.x86_64

They are useful if you in Eclipse want to single-step into Java library functions.

villykruse gravatar imagevillykruse ( 2019-01-14 01:48:49 -0500 )edit

Then should be "OpenJRE" not "OpenJDK".

rigbyk3 gravatar imagerigbyk3 ( 2019-01-14 12:35:12 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-01-12 19:33:31 -0500

Seen: 93 times

Last updated: Jan 13