You are not logged in.

#1 2022-04-09 15:50:14

wolfito-sam
Member
Registered: 2022-04-06
Posts: 25

[SOLVED]I've installed jdk but the command javac doesn't exist

I have installed jdk with pacman:
sudo pacman -S jdk-openjdk

but when I try compile a command with "javac" the system said i not have javac

I tried run java --version and show this:

Unrecognized option: --version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

So what do I do?

Last edited by wolfito-sam (2022-09-19 04:49:12)

Offline

#2 2022-04-09 15:57:13

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED]I've installed jdk but the command javac doesn't exist

What does `archlinux-java status` show?

Offline

#3 2022-04-09 16:03:37

wolfito-sam
Member
Registered: 2022-04-06
Posts: 25

Re: [SOLVED]I've installed jdk but the command javac doesn't exist

Scimmia wrote:

What does `archlinux-java status` show?

Available Java environments:
  java-11-openjdk
  java-17-openjdk
  java-8-openjdk/jre (default)

Offline

#4 2022-04-09 16:09:14

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED]I've installed jdk but the command javac doesn't exist

So there's your issue, the Java 8 JRE (without JDK) is set as default, so that's all that will be in your $PATH. If you want to use the Java 17 JDK, you need to set that as default.

Offline

#5 2022-04-09 16:30:10

wolfito-sam
Member
Registered: 2022-04-06
Posts: 25

Re: [SOLVED]I've installed jdk but the command javac doesn't exist

Its solved, Thanks for help

Offline

Board footer

Powered by FluxBB