How to compile and run a java program in Linux

Hi,
May I know how to compile and run java program in Linux.

Thanks.
antioch_75Asked:
Who is Participating?
 
sunilvirusConnect With a Mentor Commented:
u need not always type the entire path.
you should do the following.

for eg. if jdk is installed in the directory /usr/jdk1.3
open the .profile file present in your home directory.

if there is a line starting with '$PATH' then add the above path to the path already present there.
if not the type $PATH=$PATH;/usr/jdk1.3

now to compile and run a java file (test.java)
for comilation: javac test.java
fro running   : java  test.java
0
 
girionisCommented:
0
 
cheekycjCommented:
are you looking for Java Compiler on Linux?

http://www.blackdown.org/java-linux.html
0
 
mErCuR4Commented:
javac aaa.java but before that make sure ur path is set. if not u will have to specify it. Eg. /usr/jdk1.3/bin/javac aaa.java
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.