March 19, 2024, 04:07:56 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Java  (Read 8099 times)

Offline akashyak

  • Tux Awared
  • **
  • Posts: 44
Java
« on: July 17, 2007, 03:59:40 AM »
Can I practice Java in Linux ? I'm running Ubuntu 6.10

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
Re: Java
« Reply #1 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

Offline akashyak

  • Tux Awared
  • **
  • Posts: 44
Re: Java
« Reply #2 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 ?

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
Re: Java
« Reply #3 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

Offline Ujjwol

  • Linux Learner
  • ***
  • Posts: 54
Re: Java
« Reply #4 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

Offline akashyak

  • Tux Awared
  • **
  • Posts: 44
Re: Java
« Reply #5 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.

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
Re: Java
« Reply #6 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

Offline akashyak

  • Tux Awared
  • **
  • Posts: 44
Re: Java
« Reply #7 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 ?

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
Re: Java
« Reply #8 on: July 23, 2007, 01:37:32 PM »

Offline akashyak

  • Tux Awared
  • **
  • Posts: 44
Re: Java
« Reply #9 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 ?

Offline akashyak

  • Tux Awared
  • **
  • Posts: 44
Re: Java
« Reply #10 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.

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
Re: Java
« Reply #11 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