Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7165215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:12:12+00:00 2026-05-28T14:12:12+00:00

I just wanted to play around with the jdk . Like changing the implementation

  • 0

I just wanted to play around with the jdk . Like changing the implementation of some algo in some utilities in java.util etc . I just tried copying Treemap to a new class but in the same package java.util . But when i try to use my copied class , I get

Exception in thread "main" java.lang.SecurityException: Prohibited package name: java.util
at java.lang.ClassLoader.preDefineClass(Unknown Source)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at Test.main(Test.java:7)

But i cant change the package also since Treemap is using some package access stuff from other classes in java.util .

I jst told what i did . But please do tell me if there is an easier way to change some part of jdk implementation and use the modified code ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:12:12+00:00Added an answer on May 28, 2026 at 2:12 pm

    Use -Xbootclasspath/p:mydir to load you classes into the bootstrap class loader in preference to the system classes. (p is prepend.)

    If you want to make a copy of the classes instead of replace them, then they will need to be outside of the java. If it depends upon package-private access, then you’ll need to copy the other classes to (or make them public in place with -Xbootclasspath/p:). package hierarchy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to play around with Linux and do some testing. I've tried installing
I'm just starting to play around with GTK+ and I wanted to stop bad
I never used ruby before, I just wanted to play around with HAML and
I wanted to play around with some 3D controls in WPF, but was mildly
I just wanted to play around with WPF SpellCheck a little, but although the
Just wanted to write some recursion but can't check if the child is in
I just wanted to try out some shaders on a flat image. Turns out
I just wanted the music in my activity to play endlessly (i.e. when my
I just got a new android phone, and I figured I'd play around with
I have python 2.6.1 installed on Mac OS X. I wanted to play around

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.