LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-30-2008, 08:46 PM   #1
windowsNilo
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 *Sample.java
java Sample
pause
==========================
Id really appreciate for any help
guys. Thank you.
 
Old 06-30-2008, 09:11 PM   #2
andymalato
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
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

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

http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/
http://rute.2038bug.com/index.html.gz

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
PATH=$PATH:extra_path
javac *Sample.java
java Sample

ps Welcome to LQ
 
  


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
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


All times are GMT -5. The time now is 04:31 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