This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes classpath probs Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "classpath probs" Watch "classpath probs" New topic
Author

classpath probs

sthitaprajna Das
Greenhorn

Joined: Dec 03, 2005
Posts: 1
hi everyone
can anybody get my funda clear regardin classpath setting.
wheteher i should create them by setting environment variables or create a batch file for it or whether i hav 2 set the classpath each time in the cmd prompt when i login.
i am not able to understand the difference between these approaches.
which will be easier one?
I am not able to throw my class files in to appropriate folder using -d options as well.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

It's a matter of preference really.
It also depends on the project.

For small quick apps, its easy to use the compiler's -cp switch.

Once a project has more than 2 or 3 dependencies it starts making sense sense to write a shell script (or a batch script) to set up a CLASSPATH environment variable that can be sourced from the window you will using to run javac.

If a particular workstation is only ever used for one project (rare) it might make sense to set up the environment variable from the login scripts (or My Computer in the case of Windows).

There is a FAQ entry that covers compiling servlets (with a link to the classpath FAQ from the Java In General forum).
Here:
http://faq.javaranch.com/view?CompilingServlets
[ December 03, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56191
    
  13

One word: Ant.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: classpath probs
 
Similar Threads
Strange Problem
what exactly setting a classpath means?
Configure a JDBC Connection Pool
Creating a client to consume a webservice
problen in headfirst mvc tutorial