Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm a newbie to Linux so please forgive me for asking such stupid question!

I'd installed jdk1.7.0.rpm package in RHEL6.
Where I do find the path and to execute my first java program?

share|improve this question
Possible duplicate of 18472 –  faif Sep 29 '11 at 9:31
Hi, Mohammad. It's not a stupid question, but one that has been answered in several places already - like this or this question. –  rozcietrzewiacz Sep 29 '11 at 9:40

2 Answers 2

You can list the installed files with

rpm -ql packagename

You will see somewhere a bin directory with java executable

But if the JDK RPM was correctly installed you should already find java in you path.


javac MyFirstJavaClass.java

and if everything compiles

java MyFirstClass

(If you didn't change anything the current directory . should already be in your class path)

share|improve this answer

Try either of the two:

$ which java

$ whereis java

For your first java program read this tutorial:

"Hello World!" for Solaris OS and Linux

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.