It's not a secret anymore!
The moose likes Servlets and the fly likes setting classpath in windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "setting classpath in windows" Watch "setting classpath in windows" New topic

setting classpath in windows

prabhat gupta

Joined: Aug 21, 2001
Posts: 26
I am not able to compile servlets because of some third party packages like Acme's GifEncoder do i set the classpath in windows.should i create a jar file for this.Also tell me some way to keep all packages in one directory and set that directory in my classpath.tell me how all this can be done.
It's urgent.
rob mason

Joined: Dec 12, 2001
Posts: 1
You're much better off creating a little command-file to set your development environment. Start by editing a setenv.cmd file that contains the following:
set JAVA_HOME=c:\my\java\bin\dir
set CLASSPATH=.;c:\whereever\Acme.jar;c:\other\class\files
Now, before you start devloping, just type 'setenv' from the command-line. You should be ready to go!
This is a good starting point for building your development environment.
Hope this helps.

Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

But what if you close that command line window?

What version of Windows are you using?
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 567
actually even more convenient (imo) is always launching my commandline via a batch file with my environment variables set first and then cmd, so that it stays open. From there I can start and stop Tomcat and run ant etc and they will take on the variables.
I thought there was a file in c:\winnt or c:\ somewhere that you could put stuff in to execute before the command line window opened, like autoexec.cmd? Or is that only W95/98?

I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
I agree. Here's the link:
subject: setting classpath in windows
It's not a secret anymore!