• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in UNIX ClassPath  RSS feed

 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • 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.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
export CLASS_PATH=/home/lib/
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Gregg Bolinger

Thanks for the reply.. But this is not working..Any other solution ??
 
Vijitha Kumara
Bartender
Posts: 4001
42
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
But am using java 1.5 in unix BOX
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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: 4001
42
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • 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
  • 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: 4001
42
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!