This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

class path

 
sangeeta reddy
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how and where to set the classpath
 
Steve Luke
Bartender
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sangeeta reddy:
how and where to set the classpath


For servlets this is server dependent for general classpath settings. Generally, however, all your classes should go into your web application's WEB-INF/classes/ directory and your JAR files should go into the context's WEB-INF/lib/ directory. If you have classes/jars in other places it is usually a better idea to move or copy them to the above mentioned places.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64184
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sangeeta reddy:
how and where to set the classpath
You do not set the classpath for web applications. As was pointed out, web containers look for classes in specific locations and not along any classpath.

Or perhaps your question was incomplete?
 
Vijitha Kumara
Bartender
Posts: 3908
9
Chrome Fedora Hibernate
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally, however, all your classes should go into your web application's WEB-INF/classes/ directory and your JAR files should go into the context's WEB-INF/lib/ directory


Is this mean say for example if we refer EJB from a servlet that ejb-jar should goes in to the above directory? We can put the ejb-jar with the WAR file which includes the servlet etc.. and deploy it in the container as an EAR file right?

Thanks in Advance,
 
Amit Ghorpade
Bartender
Posts: 2851
10
Fedora Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sangeeta reddy welcome to Javaranch
Firstly UseAMeaningfulSubjectLine. class path makes little sense.

Then tell us a little more detail about your problem. For what purpose are you setting the classpath. The posters above have assumed that you need it for a web application.
Is it what you are really trying to do?
 
sudhir nim
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are talking about just CLASSPATH but not in terms of web applications, On windows platform it is set as environment variable.

Look at http://www.jsptube.com/Servlet-Tutorials/setup-servlet-development-environment.html
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic