Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CLASSPATH configuration

Posted on 1997-04-01
2
Medium Priority
?
237 Views
Last Modified: 2013-11-23
I have an applet running on a Web server on the Sun,
and a browser running on a Windows NT PC.  

I want the Applet to find all the appropriate classes on the
server.  I know how to set a CLASSPATH on the client, but
I don't want the browser to look on the client.  I only want
to store the classes on the server.  

The Netscape browser will look in the html directory on the server.  However, I need to specify a path of different directories to search for classes.  Is there any way to set up a CLASSPATH on the SERVER that will be used?
If not, how do I get the Applet to look in the appropriate
places for classes?

0
Comment
Question by:gersho
2 Comments
 
LVL 2

Accepted Solution

by:
majkl earned 300 total points
ID: 1219368
There is no such way, because browser that download and interprets your classes look only in his classes. You cannot specify CLASSPATH for the server, because server treads java apllet classes files just like image or other.
So SOLUTION:
1.put all classes in same directory. Browser looks also for classes in that directory, from which main class came.

2. There is option which can you specify in <applet> tag.
Normal definition is <applet code="Test.class" WIDTH=300 HEIGHT=300></applet>
you can also use codebase ="javaclasses"  , which means that will  classes are stored in directory javaclasses.
so if dir hiearchy is
home-  (here are html documents)
     |
      -javaclasses (here are all java classes)

then he will also look in this dir else JVM wil throw ClassNotFoundException.
Hoep this helps
0
 

Author Comment

by:gersho
ID: 1219370
Clasess must be copied to same directory. As I said. Server doesn't know what kind of files it handels. It him same whether gif or class. He sends what browser wants. This depends on HTM protocol.  Httpd server just send, waht browser asks. You cannot specify where is the CLASSPATH to the web server :(

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question