Solved

class not found compile error

Posted on 2001-08-09
11
163 Views
Last Modified: 2013-11-23
hi,

   Note: newbie on java

  i've found the page
http://java.sun.com/docs/books/tutorial/applet/practical/clientExample.html

i want to try the example but when i compile
  QuoteServer.java an error (Class QouteServerThread not found ....)comes out. the compiler is looking for the QuoteServerThread.Class so i compiled first the QuoteServerThread.java (succesful!) then tried to recompile the QuoteServer.java but same error came out. how can i resolve this? thanks in advance.


ps. i copied the two .java files in my \bin directory and im using jdk1.2
0
Comment
Question by:third
[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
  • 5
  • 5
11 Comments
 
LVL 4

Expert Comment

by:sdussinger
ID: 6370951
Make sure that your classpath contains your current directory.

In windows:

set CLASSPATH=.;%CLASSPATH%

On Linux:

set CLASSPATH=.:$CLASSPATH; export CLASSPATH


Then try and build them again...

--Steve
0
 
LVL 4

Accepted Solution

by:
sdussinger earned 10 total points
ID: 6370956
Also, when you build the example, build all of the Java files at the same time.

>> javac *.java

This will ensure that all of the dependent classes in the current directory will be built as well.

--Steve
0
 
LVL 92

Expert Comment

by:objects
ID: 6370972
And you don't need to put your Java source files in /bin.
0
Industry Leaders: 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!

 
LVL 30

Author Comment

by:third
ID: 6370976
where should i set the classpath?
0
 
LVL 4

Expert Comment

by:sdussinger
ID: 6370987
There are two ways to set the classpath. You can set it from the command line using the syntax I posted earlier.

Or you can set it when you do the compile:

>> javac -cp .;%CLASSPATH% <files> under windows

>> javac -cp .:$CLASSPATH <file> under Linux

--Steve
0
 
LVL 30

Author Comment

by:third
ID: 6371034
now it worked by just using javac *.java !


(bonus) do u think this will run on PWS? do i need anything to install?


earn points here:

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=java&qid=20164282 


  i need your expert's advice.


thanks ..... a lot!!!
0
 
LVL 30

Author Comment

by:third
ID: 6371116
erratum:
 
   earn points here:
should be
   earn MORE points here:



additional 5 points question:
  is there a way to extract .class files from .jar files? in other words, unzip the .jar file.

:)
0
 
LVL 4

Expert Comment

by:sdussinger
ID: 6371128
jar -xf jarfile extract all of the file from the jar.

--Steve
0
 
LVL 30

Author Comment

by:third
ID: 6371182
thanks for the info steve, i'll accept your answers.


about PWS any info? (i'll expect ur comment)


earn MORE points here:

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=java&qid=20164282 


just in case anyone is specializing in java.net


again, thanks. c u on the thread! :)

0
 
LVL 4

Expert Comment

by:sdussinger
ID: 6371199
Just what do you want to do with PWS? I'm not real clear on the question here...

--Steve
0
 
LVL 30

Author Comment

by:third
ID: 6371296
i tested the example given in
     http://java.sun.com/docs/books/tutorial/applet/practical/clientExample.html

this is the link where i got those java sample files. i've followed the directions in setting up the program. the QuoteServer works fine as well as the applet only that the quotes (which should be changing in the applet) doesn't work. i doubt that the PWS has something to do with this since im testing it on my local PC not on a web server. do u think this could be the problem? am i lacking something that i need to install for it to work? hope to hear from u.... hope it's clear, also.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

740 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