LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   java in linux (https://www.linuxquestions.org/questions/linux-software-2/java-in-linux-87881/)

perdesiz 09-01-2003 03:38 AM

java in linux
 
I am using Redhat 9. I want to learn java programming. I do have some "Hello World!" like example codes. I want to compile and see the results of those codes. I couldn't perform just by typing "gcj example_code.java". What is the way to compile java codes in linux platform?

vanquisher 09-01-2003 03:54 AM

Re: java in linux
 
Quote:

Originally posted by perdesiz
I am using Redhat 9. I want to learn java programming. I do have some "Hello World!" like example codes. I want to compile and see the results of those codes. I couldn't perform just by typing "gcj example_code.java". What is the way to compile java codes in linux platform?
get JDK from http://java.sun.com
but i think it you could be able to compile with command 'javac' first and then use 'java' command. i use RH 7.2 and I got both of them working fine. I don't recommend gcj...

m3rc_2003 12-02-2003 10:17 AM

gcj example_code.java --main=<class contianing main method> -I <directory to search for additional classes if req>

would do fine. Additional options you can specify are:

-o3 (Optimize for speed)
-o <output file name>


All times are GMT -5. The time now is 02:47 AM.