Here you can find the source of getResourceFromBundle(Class> clazz, String location)
public static URL getResourceFromBundle(Class<?> clazz, String location)
//package com.java2s; //License from project: Open Source License import org.osgi.framework.FrameworkUtil; import java.net.URL; import java.util.Objects; public class Main { public static URL getResourceFromBundle(Class<?> clazz, String location) { Objects.requireNonNull(clazz); Objects.requireNonNull(location); return FrameworkUtil.getBundle(clazz).getResource(location); }// ww w .j a v a2 s . com }