Javac not found

How to fix the error Javac not found?

I followed a tutorial about how to make a (Miecraft) Spigot-Plugin
But when I pressed run it gave me the exitcode 127 (javac not found)
How could I fix that? Thanks in advance!

this tutorial is outdated, but I believe you can follow it if you ignore the rm * step. Also, where it asks you to create a .replit file: you already have a hidden .replit file, so whatever lines it asks you to add, just prepend to the existing file.
Alternatively, fork the example repl and work with that: Tutorial Plugin


You could also try running javac in the shell, and picking a version to install.


How do I run Javac in shell?

@UMARismyname Um, where would I need to add the lines in .replit
Here is the text from .replit:

compile = "javac -classpath .:target/dependency/* -d . $(find . -type f -name '*.java')"
run = "java -classpath .:target/dependency/* Main"
entrypoint = "src/main/java/"
hidden = ["**/*.class"]

language = "java"

packageSearch = true

pattern = "**/*.java"

start = "jdt-language-server"

language = "java"

channel = "stable-22_11"

support = true

command = "javac -classpath .:/run_dir/junit-4.12.jar:target/dependency/* -g -d . $(find . -type f -name '*.java')"

transport = "localhost:0"
connectTimeout = 60
startCommand = "java-debug"

command = "initialize"
type = "request"

adapterID = "cppdbg"
clientID = "replit"
clientName = ""
columnsStartAt1 = true
linesStartAt1 = true
locale = "en-us"
pathFormat = "path"
supportsInvalidatedEvent = true
supportsProgressReporting = true
supportsRunInTerminalRequest = true
supportsVariablePaging = true
supportsVariableType = true

command = "launch"
type = "request"

classPaths = ["."]
mainClass = "Main"

build = ["javac", "-classpath", ".:target/dependency/*", "-d", ".", "$(find . -type f -name '*.java')"]
run = ["java", "-classpath", ".:target/dependency/*", "Main"]
deploymentTarget = "cloudrun"

Since Umar said to

the lines, add them to the top of the file.

1 Like

Do I have to make a new repl (without th rm*)? Bc I added the lines to the .repl and presses run but it kept running/loading for 12minutes without finishing.

btw. I forked the tutorial project and it also didn’t work (33 - 34 error, exit code 1)

As the IDE should be warning you (if code intelligence is enabled), run is defined twice, so you’ll have to remove the existing run line. Set your .replit file to:

run="cd testplugin && mvn clean install"
compile = "javac -classpath .:target/dependency/* -d . $(find . -type f -name '*.java')"
entrypoint = "src/main/java/me.Babychaosfloh/testplugin/classes/"
modules = ["java-graalvm22.3:v11-20240209-9e3a339"]

then try following the rest of the tutorial


Think Im gonna use Intellij there I know how it works

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.