LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-19-2012, 12:51 PM   #1
Satyajeet89
LQ Newbie
 
Registered: Feb 2012
Posts: 2

Rep: Reputation: Disabled
java programming


hey guys... m new to linux cn ny one suggest me how to write n run a java programme in ubuntu 11.10
 
Old 02-19-2012, 02:31 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 210Reputation: 210Reputation: 210
Create a file called HelloWorld.java:

Code:
import java.lang.System;

public class HelloWorld {
    public static void main(String argv[]) {
        System.out.println("Hello, world of Java.\n");
    }   
}
Compile this code with the command:

Code:
javac HelloWorld.java
Run it with this command:
Code:
java HelloWorld
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Programming: Java Runtime Environment not found when trying to compile murbz Linux - Software 2 03-26-2009 04:04 AM
programming in c,c++,java vijju Linux - Newbie 3 03-11-2006 05:46 AM
java support and programming with java sharapchi Slackware 8 11-14-2005 06:47 PM
java programming asahlot Programming 3 10-13-2005 11:30 AM


All times are GMT -5. The time now is 04:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration