Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / June 2005

Tip: Looking for answers? Try searching our database.

compiling a large package...

Thread view: 
Frances Del Rio - 15 Jun 2005 14:54 GMT
I'm trying to compile src code for a large package I downloaded, all of
a sudden I'm realizing after compiling I have all the classes in same
folders where .java files are.. is there a way to separate src files
from classes to turn entire package back into a jar file?  (or is it ok
to convert to a jar file if source files are in same dirs w/the
classes?)  I've never had to compile a large package like this before..

guy who wrote package has been helping me a bit, he says to compile
entire package by doing  "javac nu\fw\jeti\backend\Start.java"
(I don't understand how compiling Start.java compiles entire package...)

but not all .java files in package get compiled..

files here

  nu\fw\jeti\plugins\emoticons

get compiled, but not here...

   nu\fw\jeti\plugins\alertwindow

(and how come files in  nu\fw\jeti\plugins\emoticons DO get compiled
when command to compile was "nu/fw/jeti/backend/Start.java

this is basically for an applet I dl'd that we need here at work, can't
use if can't re-compile all source code..  (b/c will need to change some
things..)

what way is there to compile entire package...  and then separate all
src code from class files so I can convert back to a jar file..  this
project is of more complexity and I have knowledge for and well, if
anybody can point me to places where I can find out how to do this that
would be great... (I dl'd ANT once, couldn't figure out how to use it, I
will try again...  but well, is ANT the only way?  or can this be done
"by hand"?)  thank you..  Frances
Boudewijn Dijkstra - 15 Jun 2005 20:17 GMT
> I'm trying to compile src code for a large package I downloaded, all of a
> sudden I'm realizing after compiling I have all the classes in same folders
> where .java files are.. is there a way to separate src files from classes to
> turn entire package back into a jar file?

You can tell javac where to get the source files and where to put the class
files.

> (or is it ok to convert to a jar file if source files are in same dirs w/the
> classes?)  I've never had to compile a large package like this before..
>
> guy who wrote package has been helping me a bit, he says to compile entire
> package by doing  "javac nu\fw\jeti\backend\Start.java"
> (I don't understand how compiling Start.java compiles entire package...)

If javac can't find a class file for a class mentioned in Start.java, it will
search for a source file and compile that.  Recursively.

> but not all .java files in package get compiled..
>
[quoted text clipped - 8 lines]
> (and how come files in  nu\fw\jeti\plugins\emoticons DO get compiled when
> command to compile was "nu/fw/jeti/backend/Start.java

Don't be afraid to use your brain.

> this is basically for an applet I dl'd that we need here at work, can't use
> if can't re-compile all source code..  (b/c will need to change some
[quoted text clipped - 7 lines]
> well, is ANT the only way?  or can this be done "by hand"?)  thank you..
> Frances

You could try to write a simple shell script that does all the work for you.
Remi Arntzen - 15 Jun 2005 23:32 GMT
Lets say you have directory A with a buch of *.java files.
To compile them all use javac *.java -d B
where B is the directory where all your classes will go, this will
compile all your java source code.

file directory
A
-aClass.java
-bClass.java
-B
--aClass.class
--bClass.class

That should work.

Use this for any further reference.
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javac.html
Frances Del Rio - 16 Jun 2005 15:05 GMT
> Lets say you have directory A with a buch of *.java files.
> To compile them all use javac *.java -d B
[quoted text clipped - 13 lines]
> Use this for any further reference.
> http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javac.html

this is exactly info I was looking for, thank you very much...

Frances


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.