LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 11:51 AM   #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, 01:31 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
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



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 03:04 AM
programming in c,c++,java vijju Linux - Newbie 3 03-11-2006 04:46 AM
java support and programming with java sharapchi Slackware 8 11-14-2005 05:47 PM
java programming asahlot Programming 3 10-13-2005 10:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:25 AM.

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
Open Source Consulting | Domain Registration