Solved

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

Posted on 2001-06-27
4
862 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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 the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

747 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

13 Experts available now in Live!

Get 1:1 Help Now