Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-29-2004, 08:19 PM   #1
LQ Newbie
Registered: Apr 2004
Posts: 28

Rep: Reputation: 15
shell script to compile java

Hi, I need a shell script to do this.

in some directory, ls *.java
then, go loop to compile each java file,

the output look like this

----------- in this directory have 5 java files ------------

----------- compile -----------------------------
*** compile ****
*** finish it *****

*** compile *****
*** finish it ******


Old 04-29-2004, 11:17 PM   #2
Senior Member
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
I would suggest using ant.
Old 04-30-2004, 08:20 AM   #3
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
How about:

javac *.java

Also, typically if you compile 1 java file, and it makes use of other java files that aren't compiled yet, it will compile those as well.
Old 04-30-2004, 09:24 AM   #4
Registered: Aug 2003
Location: Omaha, NE, USA
Distribution: PCLinuxOS 2007
Posts: 808

Rep: Reputation: 30
deiussum's suggestion is good, but for myself, I am an ant addict. Ant gives you a much finer, scripted control over exactly what is going on.
Old 04-30-2004, 09:42 AM   #5
Registered: Dec 2003
Location: Johannesburg, South Africa
Distribution: Mandrake
Posts: 48

Rep: Reputation: 15
just download eclipse... you can script ant builds in it if you really want, but the files compile automatically anyway so you can just set and output dir and your classes will always be there


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
booting to a fullscreen java program with a shell script sebastian.raghe Linux - Newbie 3 05-19-2005 02:42 AM
running SHell script from java anirudh Programming 2 01-07-2005 07:37 AM
Creating a shell script to run Java program paultaylor Programming 7 11-12-2004 03:11 PM
How to use Java in a Shell Script arnneisp Programming 1 07-13-2004 02:18 AM
can't launch java app from shell script... LonAllen Linux - Newbie 0 07-07-2003 08:37 AM > Forums > Non-*NIX Forums > Programming

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