Perhaps you are running on a JRE rather than a JDK?


I’ve been trying to run some Java example:

~/spaces/frp/sodium/book/swidgets/java (master ✔) ᐅ mvn test -Pclearfield

Full error message looks like this: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

Much the same with ant:

~/spaces/frp/sodium/book/swidgets/java (master ✔) ᐅ ant clearfield
Buildfile: /home/alexey/spaces/frp/sodium/book/swidgets/java/build.xml
/home/alexey/spaces/frp/sodium/book/swidgets/java/build.xml:12: The following error occurred while executing this line:
/home/alexey/spaces/frp/sodium/java/build.xml:43: Unable to find a javac compiler; is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-8-openjdk/jre"

I’ve read everything the ArchWiki says on the matter; everything looks fine.

What about archlinux-java status ?

Welcome to Manjaro! :smiling_face_with_three_hearts:

  1. Please read the information behind this link. It will help you to post necessary information.
  1. Please press the three dots below your post and then press the :pencil2:
  • If you give us information about your system, we can see what we’re talking about and make better suggestions.
  • You can do this by using inxi in a terminal or in console.
sudo inxi --admin --verbosity=7 --filter --no-host --width
  • Personally identifiable information such as serial numbers and MAC addresses are filtered out by this command
  • Presenting the information in this way allows everyone to be familiar with the format and quickly find the items they need without missing anything.
  1. Copy the output from inxi (including the command) and paste it into your post.
  • To make it more readable, add 3 backticks ``` on an extra line before and after the pasted text.

Have you already :mag: for your problem in the forum ? (Wisdom lies in asking → listening → reading :wink: )

Should be usually in /usr/lib/jvm/java-8-openjdk/bin/javac and can be found through the PATH variable:

echo $PATH

That’s the usual way how it is found.

Is jdk8-openjdk installed?

what does java -version say? It should tell you whether a jre (java runtime environment) or .jdk (java developer kit) is present on your system.

And, as the message suggests, you seem to need a jdk.

Maybe this is worth a look to understand the matter in more depth.