Solved

Using the java.util.logging package from JDK1.4 in JDK1.3?

Posted on 2001-06-27
4
864 Views
Last Modified: 2011-10-03
In a project I am working on I need the ability to Logg different messages. The logging package from the JDK1.4 is pretty much what I need. The project will be updated to JDK1.4 once it is released, but until then I have to use JDK1.3.
What I tried was to just copy the specific package into my own class structure but when I try to call a class from the logging package I get following error:

java.lang.SecurityException: Prohibited package name: java.util.logging

Why do I get this error and is there a way (other than renaming the package) to use this package without getting the error?
0
Comment
Question by:Calron
4 Comments
 
LVL 3

Accepted Solution

by:
exorcist earned 200 total points
ID: 6231895
This is a security thing. You just arent allowed to put classes in the java.* package. This is to prevent "fake" classes.
What you might try is to put these classes into the file with all java standard classes. I think it was called classes.zip once. On my linux it is called rt.jar

try to put the classes into this jar file and tell me if this works.
0
 
LVL 4

Expert Comment

by:k.jones
ID: 6232553
Try sticking it in the Java extensions directory.  Do not know if that will work, but sounds worth a try.

Cheers,
Ken Jones
0
 
LVL 5

Author Comment

by:Calron
ID: 6234031
The solution exorcist provided "worked". It got rid of the Security Exception. Then I found that that package uses some native code, so I will just have to wait until the project is switched over to JDK1.4.

Thanks for the help
0
 
LVL 1

Expert Comment

by:zeus_akkali
ID: 11793950
java.util.logging is an implmentation of the apache log4j logging.

What you can do is use the apache logging until you are in jdk1.3 and the switch to jdk 1.4 java.util.logging would be very easy.

This is the url to download the logging package from apache -
http://logging.apache.org/log4j/docs/
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
GUI builder for Eclipse? 8 35
javap bin 2 34
tomcat not starting 6 45
Desingning Refactoring existing code 2 24
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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 “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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…

773 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