Solved

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

Posted on 2001-06-27
4
866 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

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…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

726 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