wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes how to run java programs in linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to run java programs in linux" Watch "how to run java programs in linux" New topic
Author

how to run java programs in linux

Ramaswamy Narayanan
Greenhorn

Joined: Jan 19, 2005
Posts: 24
Hello friends

i want to work java in linux.
i have checked the option for java while installing the linux.
how to set path?
how to compile and run? are the commands are same?
in which editor, i have to work (like command prompt in windows).

please help me.

thank you
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

>how to set path?
You needto set the bin directory of the java installation directory in your PATH. So if you installed in /opt/java, put /opt/java/bin in your PATH. You set it the same as you would for anything else you want to set in your PATH. The exact steps/syntax to do so may vary slightly depending on what shell you use. Do a Google search for setting PATH in Linux for your shell and you should get plenty of hits to help you.

>how to compile and run? are the commands are same?
Yes the commands are the same on Unix, Linux, Windows, etc. javac and java

>in which editor, i have to work (like command prompt in windows).
You can edit using any plain text editor: vi, vim, emacs, EditPad, etc. The editor can be command line or GUI based, as long as it is a plain text editor (i.e. saves files in plain text and not binary, and doesn't insert any formatting or additional markup). You will need to use a command line to compile and run from.
[ February 16, 2005: Message edited by: Mark Vedder ]
Evgeni Shuster
Greenhorn

Joined: Feb 13, 2005
Posts: 15
You can check topic:
installation problem in linux
it is posted just 2 lines before yours.
It is information there about setting JAVA_HOME, PATH and CLASSPATH environment variables.
Evgeni Shuster
Greenhorn

Joined: Feb 13, 2005
Posts: 15
One more thing, about editor.
I highly recommend JEdit.
It's written on java and for java, so it can run on any platform (including Linux and Windows) and has some useful features for java programming.
You can download it for free at
www.jedit.org
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Originally posted by Evgeni Shuster:
You can check topic:
installation problem in linux
it is posted just 2 lines before yours.
It is information there about setting JAVA_HOME, PATH and CLASSPATH environment variables.


Whenever a new reply is added to a thread, the whole thread moves to the top of the list. This means that telling someone to look at another thread "2 lines down" is typically not very helpful. At the time that I read this thread, it was 3 lines further down. By the time I post this message, it will be even further away. This just means that you should provide a link directly to the thread in question: check out this thread.
[ February 16, 2005: Message edited by: Layne Lund ]

Java API Documentation
The Java Tutorial
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to run java programs in linux
 
Similar Threads
how to implement system calls in linux through java
Run NetBeans Application in windows using terminal in linux
about java and linux
newbie question
java and linux