Solved

CLASSPATH configuration

Posted on 1997-04-01
2
224 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
majkl earned 100 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

Suggested Solutions

Title # Comments Views Activity
JavaFX TableView not displaying correctly 3 162
Eclipse Java import and method not resolved 4 135
Java Eclipse Loop 3 49
Coding for the first time 9 103
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

751 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