how do in install and run java on red hat linux 9
we have already installed jre self extracting file but javac command to compile java files doesnt work
we have already setpath
are there any other terminal commands
what is the meaning of javaconfig

Dani AI

Generated

As and pointed out, compiling needs the JDK — a JRE-only install will not provide javac. 's suggestion about checking errors and JAVA_HOME is useful; below is a concise diagnostic + fix list for Red Hat Linux 9 that resolves the usual causes of "javac not found."

Start by confirming what the system currently sees:

java -version
javac -version
which java
which javac
echo $JAVA_HOME
echo $PATH

If javac is missing, install the JDK (either the Sun/Oracle RPM or the JDK tarball). After installing, point the shell at the JDK and export the variables so new terminals see it. For a typical JDK layout:

export JAVA_HOME=/usr/java/j2sdk1.4.2_08
export PATH=$JAVA_HOME/bin:$PATH

Put those lines in ~/.bash_profile (per-user) or /etc/profile.d/java.sh (system-wide) and re-login.

On Red Hat it's cleaner to register the binaries with the alternatives system so you can switch versions without breaking packages. Example sequence:

alternatives --install /usr/bin/java java /usr/java/j2sdk1.4.2_08/bin/java 20000
alternatives --install /usr/bin/javac javac /usr/java/j2sdk1.4.2_08/bin/javac 20000
alternatives --config java
alternatives --config javac

About javaconfig: if present on your system it is a small helper script shipped with some Java packages to register the runtime/plugin or adjust system links. Run javaconfig --help or man javaconfig to see what it does on your install.

Quick troubleshooting tips: ensure the JDK you installed actually contains bin/javac (some downloads are JRE-only), make sure the JDK bin appears before any GCJ or other Java implementation in PATH, and restart your shell after editing profile files.

Recommended Answers

All 3 Replies

JRE is just the runtime environment for Java, which is for the sole purpose of running applications that have already been compiled into Java bytecode. If you actually want to do any sort of software development with Java, you'll have to install the SDK, freely available from Sun's website.

yeah you need the JDK

Hey there,

What error do you get when you try to use javac?

Also, is your JAVA_HOME variable set, and $JAVA_HOME/bin in your PATH?

Thanks :)

, Mike

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.