Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 468 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
How to make my default classloader a URLClassloader in Java 11?

I am trying to migrate from Java 8 to Java 11 and the most painful surprise was that the AppClassLoader (also known as the application or system classloader) can no longer be cast as a URLClassloader.
Worse, everything I found through google that refers to using a custom classloader are simple examples that show how to create a new classloader (yes, even extending URLClassloader) but stop there, with a manual instantiation of a class. Nothing on how to make it so that all classes loaded *after* instantiating it to be loaded through *that* classloader instead of the previous default.
So I have a couple of questions:
1) Does the Tomcat 9 running on Java 11 *common* classloader (the one used by libraries) still return a URLClassloader? I am guessing yes, since they built this whole container classloader hierarchy, so I am hoping they used the URLClassloader as their base. But if no, can someone recommend a different web application server that relies on URLClassLoaders?
2) For command line applications this is even more critical. I need to create a URLClassloader (with the App class loader as its parent) and then make it the default for the rest of the application classloading. Can someone point me to a good guide for this kind of design?