Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > jars v. classes

Reply
Thread Tools

jars v. classes

 
 
soup_or_power@yahoo.com
Guest
Posts: n/a
 
      11-10-2005
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.

 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      11-10-2005
On 10 Nov 2005 05:58:06 -0800, wrote, quoted
or indirectly quoted someone who said :

>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
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      11-10-2005
wrote:

> ...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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add *.jars to *.jars possible/recommendend? Eclipse setup for this? Ulf Meinhardt Java 2 02-03-2010 04:11 PM
Loading image from jars from other jars etc JavaEnquirer Java 2 02-22-2006 03:42 PM
JARs containing JARs alan@engrm.com Java 5 05-19-2005 04:55 PM
exec jars w/dependent jars Ike Java 6 09-24-2004 06:03 PM
java -verbose doesn't show "loaded from" for classes loaded from custom jars in the classpath Udo Corban Java 0 01-23-2004 09:32 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57