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
1  
Possible duplicate of 18472 –  faif Sep 29 '11 at 9:31
1  
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
add comment

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.

Try

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
add comment

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
add comment

Your Answer

 
discard

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.