Nashorn Context objects currently have two class loaders: the one passed from the factory as the "application" class loader, as well as an optional "classpath" URL class loader loading classes specified by the optional -classpath command line argument. When a classPathLoader is present Context code is doing a lookup in classPathLoader with a fallback to appLoader. This should be simplified to a single class loader: when -classpath is specified the newly created URLClassLoader should simply have the appLoader as its parent.
|