I want to configure the server to run java and javac command. I have code that works into my local windows system but not into live Centos.
I have been given VM where I can check the JAVA version but the JAVAC command is not working. Also when I try to execute simple hello world java code it's not working. The following are some configuration details that I found. I have tried to locate the javac executable but I am unable to locate it.
CentOS Version
[root@server2 java]# rpm --query centos-release
centos-release-8.1-1.1911.0.9.el8.x86_64
Finding java package details
[root@server2 java]# find /usr -name java
/usr/share/java
/usr/bin/java
/usr/lib/java
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el8_1.x86_64/jre/bin/java
Finding Java version
[root@server2 /]# java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
Finding Javac version ( Java compiler ) ( Also tested 'locate javac' )
[root@server2 /]# javac -version
bash: javac: command not found
Tried to run simple HelloWorld.java ( This works into local window system )
[root@server2 java]# java HelloWorld.java
Error: Could not find or load main class HelloWorld.java
Question/Suggestion
- How to know if JavaCompiler is already installed or not?
- If already installed how to find the correct path and set into the environment.
Any suggestions or solutions appreciated.