Solved

sun.tools.java.*;

Posted on 1998-08-18
5
217 Views
Last Modified: 2010-05-18
Hello,
In jdk1.1, there was a package sun.tools.java, with sun.tools.java.Scanner and sun.tools.java.Constants in it.  Does anyone know where I can find these classes in jdk1.2beta4?
Thanks in advance.
Gamestor
0
Comment
Question by:Gamestor
  • 2
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
evijay earned 70 total points
ID: 1222047
in the lib directory, there is  tools.jar file which has all these classes.


0
 

Expert Comment

by:awilkins
ID: 1222048
I don't think that's quite what Gamestor meant -- he wants to know where in the jdk 1.2beta4 package hierarchy these classes are, not their physical location on the hard drive.  Trying to import sun.tools.java results in a compiler error:  
    Package sun.tools.java not found in import.
He wants to know what package you should import instead.

    As far as I can tell, sun.tools.java is not present in any form at all in the jdk1.2beta4, but I could be wrong.  I couldn't find either 'Scanner' or 'Constants' in the index, though.

  -- Alexander Wilkins
0
 
LVL 4

Expert Comment

by:evijay
ID: 1222049
sun.tools package is undocumented package which can be used at our own risk since sun doesnt provide any support for these packages.

give the command

jar tvf lib\tools.jar in the jdk1.2 installed directory and you will see all these files in the display.

you can use them without any problems.
 in fact a lot of them are quite useful. Read the java secrets book which contain a lot of undocumented classes which is a treasure for programmer.

to use them, include tools.jar in the classpath.


0
 

Expert Comment

by:awilkins
ID: 1222050
Whoops--sorry, evijay.  My fingers sometimes shift to fifth while my brain is stuck in neutral.  I should nave thought longer before replying.

  Sincerely --
    Alexander Wilkins
0
 

Author Comment

by:Gamestor
ID: 1222051
Thanks to both of you.  It really helped.

Gamestor
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

910 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

20 Experts available now in Live!

Get 1:1 Help Now