• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Problem in UNIX ClassPath

 
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI

I need to set classpath for 15 jar files. I guess the below idea is bad, for setting one by one.

Any way to set a classpath for lib folder. So that all the jar files have to be in classpath.Instead of setting one by one.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
export CLASS_PATH=/home/lib/
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI Gregg Bolinger

Thanks for the reply.. But this is not working..Any other solution ??
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the classpath wildcards since JDK 6.
You may take a look at this
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But am using java 1.5 in unix BOX
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JVM only looks at the environment variable CLASSPATH (not: CLASSES12_PATH, J2EE_PATH or CLASS_PATH).
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am getting this erroreven after setting the classpath

$ CLASSPATH=/home/oc4j/j2ee/home/lib/
$ echo $CLASSPATH
/home/oc4j/j2ee/home/lib/


MDBBean.java:27: cannot find symbol
symbol : class MessageDrivenContext
location: package javax.ejb
import javax.ejb.MessageDrivenContext;
 
Vijitha Kumara
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That error gives what's wrong, isn't it? You don't have JEE jar file (which contains the package javax.ejb) in your CLASSPATH.
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No Javax.ejb is in ejb.jar and this ejb.jar is in lib. I checked
 
Vijitha Kumara
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to one of your previous replies you are using JDK 5. Your CLASSPATH contains only the lib directory not the jar (whatever you are using). Do you get the point now? How come JVM finds it without specifying the jar file?
 
reply
    Bookmark Topic Watch Topic
  • New Topic