Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

"Import"-question

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
shtern
Asked:
shtern
1 Solution
 
MichaelSonnyCommented:
Set the Environment Variable CLASSPATH to the directory where classes of sun are stored!
0
 
OviCommented:
Use declarations in your code like :

sun.tools.java.'a class' member = new sun.tools.java.'a class'(params);
0
 
falterCommented:
Did you get the problem during compile time or runtime?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mmuruganandamCommented:
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
 
shternAuthor Commented:
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
 
objectsCommented:
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
 
objectsCommented:
Thanks for the points :)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now