Class NetBeansProjectJVM

java.lang.Object
uno.anahata.ai.nb.tools.NetBeansProjectJVM

public class NetBeansProjectJVM extends Object
A NetBeans-aware wrapper around the core RunningJVM tool. This tool understands NetBeans projects and can execute code within their specific context, enabling a "hot-reload" workflow by prioritizing a project's compiled output.
Author:
Anahata
  • Constructor Details

    • NetBeansProjectJVM

      public NetBeansProjectJVM()
  • Method Details

    • compileAndExecuteInProject

      public static Object compileAndExecuteInProject(String projectId, String sourceCode, boolean includeCompileAndExecuteDependencies, boolean includeTestDependencies, String[] compilerOptions) throws Exception
      Compiles and executes Java source code within the context of a specific NetBeans project.
      Parameters:
      projectId - The ID (directory name) of the NetBeans project to run in.
      sourceCode - Source code of a public class named Anahata that has no package declaration and implements java.util.concurrent.Callable.
      includeCompileAndExecuteDependencies - Whether to include the project's COMPILE and EXECUTE dependencies.
      includeTestDependencies - Whether to include the project's test source folders and test dependencies.
      compilerOptions - Optional additional compiler options.
      Returns:
      The result of the execution.
      Throws:
      Exception - on error.