Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

class not found compile error

Posted on 2001-08-09
11
Medium Priority
?
169 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 40 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

688 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