-
Compiling error - A package not found
Hi
I am having a compiling error - import package com.thinaccess.sql.* not found
when I try to compile an applet having a import com.thinaccess.sql.*; in
its source file in JDK2.
I would like to be able to compile the applet in my development PC. I know
that the thinaccess driver resides in the thinaccess.jar file.
So I created a com/thinaccess/sql directory inside the c:/jdk2/bin directory
and I put the thinaccess.jar files inside the com/thinaccess/sql directory
that I have created. I then try to compile the applet again but still the
same error comes out.
Can anyone assist me in being able to compile the applet in my development
PC.
rgds,
Saiful
-
Re: Compiling error - A package not found
Assuming you are running on a Windows platform. One of the ways that
the java compiler - and runtime system - uses to find classes for
import is via the CLASSPATH environment variable. this contains a list
of all directories and jar files that should be searched for imported
pacakages. By default this will simply be the current directory and
the standard java run time jar (rt.jar). There are a few ways of
referencing your new files:-
1) If you want to add your own jar files to the system for all
applications, then you could specify the CLASSPATH variable, for
example if I wish to add fred.jar and thinaccess.jar that reside in a
directory called c:\jarfiles, to my system then my CLASSPATH will look
like the following, notice that the first entry is a dot, i.e. the
current directory, and the delimiter is a semicolon:
".;c:\jarfiles\fred.jar;c:\jarfiles\thinaccess"
during the import process the system will now search, the runtime
system, the current directory structure, fred,jar and thinaccess. If
you were adding this to the autoexec then it would have a line like:
SET CLASSPATH=.;c:\jarfiles\fred.jar;c:\jarfiles\thinaccess
or alternatively use the Settings dialogues. You can then execute your
code using
java MyApplicationClass
2) If you want to test your own files without altering the CLASSPATH
variable on the system then you can set the classpath at the time of
running your code:
java -classpath .;c:\jarfiles\fred.jar;c:\jarfiles\thinaccess
MyApplicationClass
[above should be typed all on one line]
this sets the classpath only for this run of this app,
3) Look into the ability to add jar files as 'extensions' to the
standard set. These are then searched automatically by the import
mechanism without any changes needed to the CLASSPATH. I suggest you
try one of the first two methods initially and have a look at
extensions when you are happier with the way that searching happens.
When you are ready for this have a look at:
http://www.javasoft.com/docs/books/t...ext/index.html
HTH
--
Kim
On 28 Sep 2000 21:12:02 -0700, "Saiful" <md-saifulamri_omar@hp.com>
did scribble:
>
>Hi
>
>I am having a compiling error - import package com.thinaccess.sql.* not found
>when I try to compile an applet having a import com.thinaccess.sql.*; in
>its source file in JDK2.
>
>I would like to be able to compile the applet in my development PC. I know
>that the thinaccess driver resides in the thinaccess.jar file.
>
>So I created a com/thinaccess/sql directory inside the c:/jdk2/bin directory
>and I put the thinaccess.jar files inside the com/thinaccess/sql directory
>that I have created. I then try to compile the applet again but still the
>same error comes out.
>
>Can anyone assist me in being able to compile the applet in my development
>PC.
>
>rgds,
>Saiful
--
Kim
Kim Fowler
-
Re: Compiling error - A package not found
Just one little addition to youre anwer.
If you use:
>".;c:\jarfiles\fred.jar;c:\jarfiles\thinaccess"
thinacces.jar will NOT be searched. The line should read as follows:
".;c:\jarfiles\fred.jar;c:\jarfiles\thinaccess.jar"
I think this was just a typo, but it can be very annoying for a beginner
to track down the problem.
Regards
Thomas Weinstein
-
Re: Compiling error - A package not found
Thomas,
Many thanks for spotting the typo, as you say it would be .....
irritating ? .......... for a beginnner to try to find, thanks again
Regards
Kim
]
On 3 Oct 2000 09:17:38 -0700, "Thomas Weinstein" <Th.Weinstein@xcc.de>
did scribble:
>
>Just one little addition to youre anwer.
>If you use:
>
>>".;c:\jarfiles\fred.jar;c:\jarfiles\thinaccess"
>
>thinacces.jar will NOT be searched. The line should read as follows:
>
>".;c:\jarfiles\fred.jar;c:\jarfiles\thinaccess.jar"
>
>I think this was just a typo, but it can be very annoying for a beginner
>to track down the problem.
>
>Regards
>
>Thomas Weinstein
>
>
--
Kim
Kim Fowler
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks