You are not logged in.

#1 2017-09-25 23:30:55

redeemedofgod
Member
From: North Carolina
Registered: 2017-05-23
Posts: 14

[Solved] Javac not found - JDK and JRE both installed

Hello,

I have an interesting problem. I installed the 'jdk9-openjdk' and tried running javac, but javac is apparently not found. I heard that maybe I needed to reboot my computer to update the $PATH variable, so I did, but this did not help. Doing some research I found a couple of threads that suggested to see the output of

 file /usr/bin/javac 

and the output is:

 /usr/bin/javac: broken symbolic link to /usr/lib/jvm/default/bin/javac 

I find this interesting because if I search in /usr/lib/jvm/default/bin/ I cannot find javac there either! I tried installing jdk8-openjdk to see if downgrading would help because I read how new jdk9 was. The issue persists, however sad any ideas?

Thank you

Last edited by redeemedofgod (2017-09-26 02:24:48)

Offline

#2 2017-09-26 01:43:01

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: [Solved] Javac not found - JDK and JRE both installed

That the file is not at /usr/lib/jvm/default/bin/javac  is the reason the link is broken

On my system:

ewaller@turing ~ 1005 %pacman -Qo  /usr/lib/jvm/default/bin/javac

/usr/lib/jvm/java-7-openjdk/bin/javac is owned by jdk7-openjdk 7.u151_2.6.11-1
ewaller@turing ~ 1006 %

How was it that you installed jdk8-openjdk ?

Last edited by ewaller (2017-09-26 01:43:18)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2017-09-26 02:05:31

redeemedofgod
Member
From: North Carolina
Registered: 2017-05-23
Posts: 14

Re: [Solved] Javac not found - JDK and JRE both installed

Hello,

if I type your above command, I get the following:

 [daniel@silverback ~]$ pacman -Qo /usr/lib/jvm/default/bin/javac
error: failed to read file '/usr/lib/jvm/default/bin/javac': No such file or directory

I just installed JDK8 on top of 9, I didn't uninstall it first.

Offline

#4 2017-09-26 02:20:09

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: [Solved] Javac not found - JDK and JRE both installed

Sounds like you haven't set the default java. Use archlinux-java

Offline

#5 2017-09-26 02:24:16

redeemedofgod
Member
From: North Carolina
Registered: 2017-05-23
Posts: 14

Re: [Solved] Javac not found - JDK and JRE both installed

Oh my goodness! It was as simple as that! I'm sorry, to even have waisted time. it was set to jdk7 which isn't even installed on my system. I'm marking as solved now.

Offline

#6 2017-09-26 02:46:30

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: [Solved] Javac not found - JDK and JRE both installed

No reason to be sorry, that's what the Newbie Corner is for.

Offline

Board footer

Powered by FluxBB