3

I am currently at a loss as to why this is happening.

I did some basic research by running:

# whereis javac

and

# find / -name javac

...and I came up with nothing.

I searched the web for answers but they all seem to focus on javac existing on the filesystem, and that needs to be done is to restore a missing symlink.

Has anyone run up against this issue and found a solution?

I have attempted to install openJDK on Scientific Linux 6.3 with the command:

# yum install openjdk

6 Answers 6

2

You actually just need to install java-[version]-openjdk-devel, because the base package doesn't include compilers or other developer tools. This contains /usr/lib/jvm/java-[version]-openjdk-[version].[arch]/bin/javac, and will use the alternatives system to set up a symlink to /usr/bin/javac.

1
  • 3
    Someone needs to tell the package maintainers what the 'd' stands for in 'jdk'! Apr 4, 2014 at 18:41
0
javac: Command not found

If you receive this error, UNIX cannot find the compiler, javac.

Here's one way to tell UNIX where to find javac. Suppose you installed the JDK in /usr/local/jdk1.8.0. At the prompt you would type the following command and press Return:

/usr/local/jdk1.8.0/javac hello.java

Note: If you choose this option, each time you compile or run a program, you'll have to precede your javac and java commands with /usr/local/jdk1.8.0/. To avoid this extra typing, you could add this information to your PATH variable. The steps for doing so will vary depending on which shell you are currently running.

Class names, 'hello', are only accepted if annotation processing is explicitly requested

If you receive this error, you forgot to include the .java suffix when compiling the program. Remember, the command is javac hello.java not javac hello.

For more details, consult this lecture "Creating a Hello World application" in this page. http://learnjavaeasy.com/course/learn-java-online-with-java-8-by-examples/

0

install developer tools e.g if you are using 1.7 RHEL install yum install java-1.7.0-openjdk-devel and this will install javac

-1

Yum list openjdk to make sure the file is in the rpm then you can run yum whatprovides *\javac to see all packages that contain the binary.

1
  • yum list doesn't do what you think it does. yum provides is a good suggestion, though. Oct 14, 2012 at 20:51
-1

Have you tried making a softlink from the library utility location to your terms or bin dir?
Have you tried?

grep -r javac /usr/jdk
-1

Javac is not included in the OpenJDK package. You will need the JDK package from Oracle in order to get that, and other, executable java programs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .