Solved

CLASSPATH configuration

Posted on 1997-04-01
2
212 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 100 total points
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now