Attempts to load the specified class.
Attempts to load the specified class.
The full name of the class to load
If true, initializes the class
The class loader to use for loading the class, defaults to the system class loader
The class loaded by the class loader
If the class was not found using the class loader or any of its parents
Exposed for testing!
Returns a random port that is currently open.
Returns a random port that is currently open. Note that there is no safety condition preventing this port from being taken later.
The number of the port
Attempts to find potential paths for a jar in the JDK.
Attempts to find potential paths for a jar in the JDK.
The path to the jar relative to the JDK
The sequence of potential paths
Generates a JDWP string for use when launching JVMs.
Generates a JDWP string for use when launching JVMs.
The port used to connect to a debugger or listen for debugger connections
The means of communication (defaults to dt_socket)
If true, indicates that the target JVM should run as a server listening on the provided port for debugger connections; if false, indicates that the target JVM should connect to a debugger using the provided port
If true, indicates that the target JVM should start up suspended until a connection with a debugger has been established
If provided, used as the hostname to connect or bind to depending on the server flag
The string representing the JDWP settings
Retrieves the system property for java.
Retrieves the system property for java.class.path.
The string representing the 'java.class.path' system property
Retrieves the system property for path.
Retrieves the system property for path.separator.
The string representing the 'path.separator' system property
Retrieves the system classloader.
Retrieves the system property for user.
Retrieves the system property for user.dir.
The string representing the 'user.dir' system property
Checks if it is possible to use the JDI using either the given class loader or by using a jar located in the JDK (if possible).
Checks if it is possible to use the JDI using either the given class loader or by using a jar located in the JDK (if possible).
The class loader to use to check for JDI (default is this class's class loader)
True if JDI is able to be loaded, otherwise false
Collects a list of active Java processes using the JPS tool.
Collects a list of active Java processes using the JPS tool.
Optional function to convert line of text into a Java process instance
The collection of active Java processes
Will fail if the JPS tool is not on PATH.
Retrieves a JVM classpath string that contains the current classpath.
Retrieves a JVM classpath string that contains the current classpath.
The classpath as a string
Creates a new JDI process instance.
Creates a new JDI process instance.
The new JDI process instance
Converts a class string to a file string.
Converts a class string to a file string.
The class string to convert
The resulting file string
org.senkbeil.MyClass becomes org/senkbeil/MyClass.scala
Spawns a new Scala process using the provided class name as the entrypoint.
Spawns a new Scala process using the provided class name as the entrypoint.
The name of the class to use as the entrypoint for the Scala process
The port to use for the Scala process to listen on
Optional hostname to use for the Scala process to listen on
Whether or not to launch the process as a server waiting for a debugger connection or a client connecting to a listening debugger
Whether or not to start the process suspended until a debugger attaches to it or it attaches to a debugger
The collection of arguments to pass to the Scala process
Any additional JVM options to pass to the Scala process
The created Scala process
Assumes that Scala is available on the path!
Spawns a new Scala process using the provided class name as the entrypoint.
Spawns a new Scala process using the provided class name as the entrypoint. Retrieves the PID of the process. The spawned JVM cannot start suspended.
The name of the class to use as the entrypoint for the Scala process
The port to use for the Scala process to listen on
Optional hostname to use for the Scala process to listen on
Whether or not to launch the process as a server waiting for a debugger connection or a client connecting to a listening debugger
The collection of arguments to pass to the Scala process
Any additional JVM options to pass to the Scala process
The tuple containing the PID (or 0 if failed to retrieve) and the Scala process
Assumes that Scala is available on the path!
Spawns a new process to retrieve the list of Java processes.
Spawns a new process to retrieve the list of Java processes.
The process instance
Attempts to ensure that the JDI is loaded.
Attempts to ensure that the JDI is loaded. First, checks if the JDI is already available. If not, attempts to find a JDK path and load it.
The class loader to use to check for JDI (default is this class's class loader)
True if successful, otherwise false
Finds an open port and provides it to the specified function.
Finds an open port and provides it to the specified function. This method is synchronized to prevent other threads within the same application from accidentally taking the same port when using this method; however, this does not prevent external applications from consuming the provided port.
The return value from the function to evaluate
The function to evaluate, taking the open port as its argument
The result of the evaluated function
When no port is available
Contains utility methods related to the Java Debugger Interface.