LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to work with java programs in linux ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-work-with-java-programs-in-linux-858102/)

mhawk 01-23-2011 04:23 AM

how to work with java programs in linux ?
 
how to work with java programs in linux redhat?

ashwinipatankar 01-23-2011 06:02 AM

Case 1: writing and compiling Java codes
write a Hello World code save it as .java
go to the terminal, then go the directory where you saved your code.
type
javac <filename>.java
all set to go.

Case II: running .jar files
java -jar <filename>

vigilandy 01-23-2011 06:58 AM

mhawk, are you developing programs, or just running a java application?

ashwinipatankar gave some good tips for either case, but you also need to verify that java is installed on your machine. you can check just by typing on the command line:
Code:

java -version
If you get "command not found", you will need to install java. The procedure depends on which distribution you're using. You could also try installing java using the installer from oracle, but I recommend using the package manager for your distribution.

You can also try out openJDK, which should also be available via your package manager.

bloodyscript 01-24-2011 07:10 AM

also if your looking for an editor program theres eclipse


All times are GMT -5. The time now is 07:43 AM.