Results 1 to 7 of 7
Hello there
I was wondering how can I compile a Java code in RedHat!!!
you know in C I write
gcc <filename> ... to compite it
./a.out ................. to see ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-30-2004 #1Just Joined!
- Join Date
- Oct 2004
- Location
- Syria
- Posts
- 9
Java compiling!!!!
Hello there

I was wondering how can I compile a Java code in RedHat!!!
you know in C I write
gcc <filename> ... to compite it
./a.out ................. to see the out put...
thx for your time....
- 11-30-2004 #2Just Joined!
- Join Date
- Jan 2004
- Location
- Portugal
- Posts
- 93
try
Code:javac file.class
- 11-30-2004 #3Linux User
- Join Date
- Jul 2004
- Location
- Poland
- Posts
- 368
Of course, you have to have Java SDK (software developement kit) installed and configured in order to be able to compile anything.
"I don't know what I'm running from
And I don't know where I'm running to
There's something deep and strange inside of me I see"
- 11-30-2004 #4Linux Enthusiast
- Join Date
- Jun 2002
- Location
- San Antonio
- Posts
- 621
Also, you don't compile class files. You compile java files into class files. That would be like putting toast into a toaster.
Will compile the java file into TestClass.class (assuming the java file contained the line "class TestClass"). You can then run:Code:javac TestClass.java
so long as the TestClass.java file has a main() function definedCode:java TestClass

Best,
SamuelI respectfully decline the invitation to join your delusion.
- 11-30-2004 #5Just Joined!
- Join Date
- Jan 2004
- Location
- Portugal
- Posts
- 93
That's right, sorry for the mix-up....

but since we're on the topic of java:
How do you compile into .jar ??
What are the diferences to compiling to .class? (besides the number of files=)
- 11-30-2004 #6Linux Enthusiast
- Join Date
- Jun 2002
- Location
- San Antonio
- Posts
- 621
You don't compile into a jar. You compile a bunch of class files into a directory heirarchy. Then you zip them up into a jar. That's right, jar is just zip. Try it sometime. 'unzip /usr/local/jdk1.3.1/demo/jpda/examples.jar'.
Best,
SamuelI respectfully decline the invitation to join your delusion.
- 12-01-2004 #7Just Joined!
- Join Date
- Oct 2004
- Location
- Syria
- Posts
- 9
THX!
Thank you all for the help!

Have great time!
ZTH


Reply With Quote
