Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Linux in General => Linux Development & Programming => Topic started by: akashyak on July 17, 2007, 03:59:40 AM

Title: Java
Post by: akashyak on July 17, 2007, 03:59:40 AM
Can I practice Java in Linux ? I'm running Ubuntu 6.10
Title: Re: Java
Post by: gauravbajaj on July 17, 2007, 06:53:21 AM
Yeah you can practise it , In some distribution Java is somewhat inbuild but I don't know about Ubuntu as I never got a chance to worked with it.

You can browse this link to know more:
https://help.ubuntu.com/community/Java (https://help.ubuntu.com/community/Java)
Title: Re: Java
Post by: akashyak on July 18, 2007, 09:12:32 AM
Well thank you... but unfortunately my Internet connexn runs at 115kbps or below. My office system runs faster, but ...

Can it be possible that Java is available pre-recorded on a CD that can be run and installed in Linux ?
Title: Re: Java
Post by: gauravbajaj on July 18, 2007, 09:25:46 AM
Yeah as I already said that Java is inbuild in some distributions like SUSE ............., Don't know about Ubuntu.......but you can run command to know wheather its there or not using:

#java -version

Thanks
Gaurav
Title: Re: Java
Post by: Ujjwol on July 19, 2007, 06:04:23 AM
Yeah as I already said that Java is inbuild in some distributions like SUSE ............., Don't know about Ubuntu.......but you can run command to know wheather its there or not using:

#java -version

Thanks
Gaurav
i search for java development kit rpm i din't find
can any body provide me the link
only virtual libary is inbuilt in my RHEL WS 4
thanks in advance
Title: Re: Java
Post by: akashyak on July 19, 2007, 07:12:45 AM
I typed "java -version" in my Terminal, and got this:

****************
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-14ubuntu7)

*******************

What does it mean ? Can you explain. plz ? ThanQ.
Title: Re: Java
Post by: gauravbajaj on July 20, 2007, 09:04:52 AM
It means that java is installed on your system and the version is 1.4.2, So you can run your java program there .

Try to make first program of java and name it as test.java
Compile it  same as in Windows using
#javac test.java

After that execute it using
#java test

Thanks
Gaurav
Title: Re: Java
Post by: akashyak on July 20, 2007, 04:43:49 PM
Oh thank you so much Gaurav. I was thinking of asking for compilation and execution commands.

By the way, is there a good resource on the Internet that teaches java in linux ?
Title: Re: Java
Post by: gauravbajaj on July 23, 2007, 01:37:32 PM
Try this

http://www.yolinux.com/TUTORIALS/LinuxTutorialJava.html#TUTORIALS (http://www.yolinux.com/TUTORIALS/LinuxTutorialJava.html#TUTORIALS)

Thanks
Gaurav
Title: Re: Java
Post by: akashyak on July 31, 2007, 11:45:13 PM
And for my last question:

even after I have installed Java SE 6 Update 2 on my linux machine, I get the answer 1.4.2 when I type 'java -version' in my terminal.

And then, I try to compile and run the following program:

(start)
/* This is my first Java applicaiton */
class Application
{
 public static void main(String args[])
 {
  System.out.println("This is my First java applicaiton");
 }
}
(end)

it compiles well without an error or warning. And when I run it, it runs well, but does not produce any output what so ever. Why is this ? Can you tell me ?
Title: Re: Java
Post by: akashyak on August 29, 2007, 10:59:58 AM
Oh thanks Gaurav, I had got confused by # in your previous response, and typed it myself in front of javac test.java

So I had to type at the # prompt "javac test.java", and not "#javac test.java" at the hash prompt (with a redundant #)

Thank you.
akash.
Title: Re: Java
Post by: gauravbajaj on September 18, 2007, 10:25:23 AM
Srry Login after a long time , Its Great to hear that it worked for you

Thanks
Gaurav