public class NGClasspath
extends java.lang.Object
Provides a means to display and add to the system classpath at runtime. If called with no arguments, the classpath is displayed. Otherwise, each argument is turned into a java.io.File and added to the classpath. Relative paths will be resolved relative to the directory in which the nailgun server is running. This is very likely to change in the future.
This is aliased by default to the command "ng-cp
".
Constructor and Description |
---|
NGClasspath() |
Modifier and Type | Method and Description |
---|---|
private static void |
addToSystemClassLoader(java.net.URL url)
Adds the specified URL (for a jar or a directory) to the System
ClassLoader.
|
static void |
nailMain(NGContext context) |
private static void addToSystemClassLoader(java.net.URL url) throws java.lang.Exception
url
- the URL of the resource (directory or jar) to add to the
System classpathjava.lang.Exception
- if anything goes wrong. The most likely culprit, should
this ever arise, would be that your VM is not using a URLClassLoader as the
System ClassLoader. This would result in a ClassClastException that you
probably can't do much about.public static void nailMain(NGContext context) throws java.lang.Exception
java.lang.Exception