Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-30-2008, 08:46 PM   #1
LQ Newbie
Registered: Jun 2008
Posts: 6

Rep: Reputation: 0
Need help for terminal commands for java please.

Hi there, Im new to linux and
I understand that the terminal
is the same as the command
prompt of windows. Correct me
if I am wrong please.
I used to create batch files for
compiling certain java programs
that I do in windows. Can
anyone help me translate this
batch file into something
for linux? What is the
equivalent of batch files
for windows in Linux?
Here is the code:
@echo off
cd c:\Documents and Settings\.....
set path=%path%;C:\j2sdk1.4.0\bin
javac *
java Sample
Id really appreciate for any help
guys. Thank you.
Old 06-30-2008, 09:11 PM   #2
LQ Newbie
Registered: Jun 2006
Distribution: Red Hat, Solaris, FreeBSD
Posts: 20

Rep: Reputation: 0
Hello --

In the UNIX/Linux world, shell scripts would be analogous to DOS/Windows batch files.

I suggest you take a look at the man page for bash in addition to the excellent tutorials out there on the web. Just google for "bash shell scripting".

Last edited by andymalato; 06-30-2008 at 09:13 PM.
Old 06-30-2008, 09:27 PM   #3
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,927

Rep: Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631
Here's some good ones:

Just FYI, there are no drive letter designations in Linux, so they all start from the root dir '/'.
Not to be confused with the root acct (Linux equiv of MS Admin acct).
Note all path separators ('slashes') are fwd in Linux vs backward ('\') in MS.
In Linux '\' is the cmd line escape char.

Your code would roughly look like this:

cd /home/user
javac *
java Sample

ps Welcome to LQ


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
making a script that opens terminal and enter commands into that terminal Cinematography Linux - General 8 12-16-2008 11:34 AM
Terminal Commands LinuxNewbie092 Linux - Newbie 8 03-23-2007 06:41 PM
java and terminal window commands manolakis Programming 4 02-03-2007 11:27 PM
Terminal commands Ermen Linux - Newbie 1 11-23-2004 11:13 AM
2 Questions: java calling system commands? PERL vs Java? randomx Programming 28 11-28-2003 09:24 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:40 PM.

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