Solved

class not found compile error

Posted on 2001-08-09
11
159 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
Comment Utility
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
Comment Utility
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
Comment Utility
And you don't need to put your Java source files in /bin.
0
 
LVL 30

Author Comment

by:third
Comment Utility
where should i set the classpath?
0
 
LVL 4

Expert Comment

by:sdussinger
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 30

Author Comment

by:third
Comment Utility
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
Comment Utility
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
Comment Utility
jar -xf jarfile extract all of the file from the jar.

--Steve
0
 
LVL 30

Author Comment

by:third
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 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…

772 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

14 Experts available now in Live!

Get 1:1 Help Now