This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes standard CLASSPATH Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "standard CLASSPATH" Watch "standard CLASSPATH" New topic
Author

standard CLASSPATH

Bob Moranski
Ranch Hand

Joined: Nov 22, 2000
Posts: 177
Hi, I was wondering if anyone knows what the standard CLASSPATH is?
Thanks in advance!
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
(Universally) "Standard"? I don't think there's such a thing


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
Bob Moranski
Ranch Hand

Joined: Nov 22, 2000
Posts: 177
Hi, I meant for servlets in tomcat.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Bob,
ClassPath we all know. From which doc you got this doubt specifically?
regds
maha anna
Bob Moranski
Ranch Hand

Joined: Nov 22, 2000
Posts: 177
Hi maha, say if we want to load an Applet that is on a separate file into our servlet? We have to place the Applet file in the standard CLASSPATH. Can you tell me what is it?
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
The applet's .class file or .jar file has to be in a directory whose'just before' directory has to be in environment var 'CLASSPATH'. For example if you package an applet's myApplet.class file in 'MISApp' package and you want to load this .class file in a .html/.jsp file then, there has to be directory structure /MISApp/myApplet.class and the parent dir which holds this MISApp , assume it is c:\bob\ , has to be set in CLASSPATH environment variable. For example in windows environment , we add a line as
set classpath=c:.;C:\bob
(in case of c:\bob\MISApp\myApplet.class )
so that the JVM knows where to get 'myApplet.class'. Other than this concept , I am not sure if the word 'standard classpath' is different from 'classpath' or not. Others can add to this.
regds
maha anna
Bob Moranski
Ranch Hand

Joined: Nov 22, 2000
Posts: 177
Hi maha, so if we wish to load myApplet.class in MISAPP, then we put it in c:\tomcat\webapps\MISAPP\myApplet.class? Outside of Web-inf?
Thanks.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Bob,
Sorry for the late reply. As per Servlet 2.2 API spec all .class files go into ROOT/Web-Inf/classes directory and the servlet container's supposed to set the ROOT/Web-inf/classes dir in JVM's classpath.
I tried putting an applet's .class file in above said classes dir and kept the .html file in /ROOT dir and called from browser. But the applet was not loaded.
Then I tried to put the .html file and applet's .class file in same /ROOT dir and tried to call this .html file from browser. Now the applet is loaded.
Another try which worked was, I kept the applet's .class file from an unrelated dir which could be separate from web server's deployment dir structure itself. Like it could be from c:\bob\myApplet.class and put c:\bob in classpath by editing the autoexec.bat file.
Now also when I called the .html file from browser, the applet in c:\bob dir was loaded.
So , yet to figure out why it was not loaded when I kept the applet's class file in /ROOT/Web-inf/classes dir.
Others can add to this.
regds
maha anna
Bob Moranski
Ranch Hand

Joined: Nov 22, 2000
Posts: 177
maha, you are so nice!
[This message has been edited by Bob Moranski (edited December 29, 2000).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: standard CLASSPATH
 
Similar Threads
set classpath in Manifest file?
two equal jar's in the same eclipse project
Compilation error when compiling through Ant
errors!!
How to upgrade wsad 5.0 to wsad 5.1.1