Solved

class not found compile error

Posted on 2001-08-09
11
160 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
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…

929 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

7 Experts available now in Live!

Get 1:1 Help Now