public static void main( String[] args ) {
		try {
			Class.forName( "com.formdev.flatlaf.FlatDarkLaf" );
			System.err.println( "Run without FlatLaf on classpath" );
			return;
		} catch( ClassNotFoundException ex ) {
			// continue
		} catch( Exception ex ) {
			ex.printStackTrace();
			return;
		}

		if( FlatClassLoaderTest.class.getResource( "/META-INF/services/com.formdev.flatlaf.FlatDefaultsAddon" ) != null ) {
			System.err.println( "Remove file 'META-INF/services/com.formdev.flatlaf.FlatDefaultsAddon'" );
			return;
		}

		try {
			@SuppressWarnings( "resource" )
			URLClassLoader cl = new URLClassLoader( new URL[] {
				new URL( "file", null, "../flatlaf-core/bin/main/" )
			}, FlatClassLoaderTest.class.getClassLoader() );

			Class<?> lafClass = cl.loadClass( "com.formdev.flatlaf.FlatDarkLaf" );
			LookAndFeel laf = (LookAndFeel) lafClass.getDeclaredConstructor().newInstance();
			UIManager.setLookAndFeel( laf );

			JFrame frame = new JFrame( "FlatClassloaderTest" );
			frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
			frame.add( new FlatClassLoaderTest() );
			frame.setBounds( 100, 100, 600, 400 );
			frame.setVisible( true );
		} catch( Exception ex ) {
			ex.printStackTrace();
		}
	}
java -classpath "<FlatLaf-root>/flatlaf-testing/bin/main" com.formdev.flatlaf.testing.FlatClassLoaderTest

@author Karl Tauber
flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatClassLoaderTest.java