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 / General / November 2005

Tip: Looking for answers? Try searching our database.

jars v. classes

Thread view: 
soup_or_power@yahoo.com - 10 Nov 2005 13:58 GMT
Hi All
I have a development environment where several jars are located say in
a directory /home/user/jars.
The java source is located say at /home/user/src. As I compile the
sources with -d option, they are placed under /home/user/jars. The
classpath contains all the jars. I am finding that when I run the code,
it is picking up stuff from jars ignoring the class files. IS there a
simple solution to fix this problem. IOW, how can I tell javac to first
look at class files and then jars. I don't enough about this
development environment dependencies to create an ant script. Your help
is appreciated.

/home/user/src ------------java files (e.g. myjara.java)
/home/user/jars -----------jars and class files

cd  /home/user/src
javac -d ../jars myjava.java

Thanks for your help.
Roedy Green - 10 Nov 2005 14:37 GMT
>I am finding that when I run the code,
>it is picking up stuff from jars ignoring the class files.

That is the way it is supposed to work. The solution is to put all
your classes in jars and to use a jar class-path.

See http://mindprod.com/jgloss/jarexe.html
http://mindprod.com/jgloss/jar.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Andrew Thompson - 10 Nov 2005 22:28 GMT
> ...The
> classpath contains all the jars.

Sun has been recommending against 'dumping every jar on
the classpath' for some time.  Because..

>...I am finding that when I run the code,
> it is picking up stuff from jars ignoring the class files.

..mostly of that, and other associated hassles.

Add Jar's and/or classes to the run of each java project
selectively, and the problem is solved.


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.