Solved

"Import"-question

Posted on 2001-06-08
7
270 Views
Last Modified: 2010-03-31
Hello!

I need to use sun-classes in my work, e.g. sun.tools.java etc. But if i just write import sun.tools.java.*, I get an error message "Package not found". What is a problem there?

Thanx.
0
Comment
Question by:shtern
7 Comments
 

Expert Comment

by:MichaelSonny
ID: 6167382
Set the Environment Variable CLASSPATH to the directory where classes of sun are stored!
0
 
LVL 9

Expert Comment

by:Ovi
ID: 6167470
Use declarations in your code like :

sun.tools.java.'a class' member = new sun.tools.java.'a class'(params);
0
 
LVL 3

Expert Comment

by:falter
ID: 6167605
Did you get the problem during compile time or runtime?
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 9

Expert Comment

by:mmuruganandam
ID: 6167804
Hello shtern,

  It might be a problem with your environment settings.  Search for the appropriate jar files which can be opened in the winzip.  Check for the classes to import.  Put that jar file in the classpath.  It will do the needful for you.

All the best

Cheers,
Muru
0
 

Author Comment

by:shtern
ID: 6168859
Falter,
I get the problem by compiling.

Muru,
how should I put the file into classpath? With the name of .jar-file, or just path?
0
 
LVL 92

Accepted Solution

by:
objects earned 200 total points
ID: 6169848
Were are the sun classes located on your system.
If they are in a jar then you'll need to include this jar in your classpath.
If they (the classes) are in a directory on your system then you'll need to include the parent directory that contains the 'sun' directory in your classpath. eg. if the files are in /stuff/classes/sun/tools/java then you'll need to include '/stuff/classes' in your classpath.

Hope this helps :)
0
 
LVL 92

Expert Comment

by:objects
ID: 6172110
Thanks for the points :)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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 will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.

758 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

18 Experts available now in Live!

Get 1:1 Help Now