You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Double-click one of the tasks to run the corresponding example (**BasicInitialization** is a good initial test).
233
233
234
-
# Gradle Build File
234
+
##Gradle Build File
235
235
236
236
The `plugins` section allows us to include plugins that provide functionality to our build file. We include the `java` plugin which provides various functionality for a Java project.
237
237
@@ -317,9 +317,64 @@ def defaultJvmArgs = [
317
317
318
318
Beyond that, a series of [JavaExec tasks](https://docs.gradle.org/current/dsl/org.gradle.api.tasks.JavaExec.html) are defined, each which provides a way to run one of the examples.
319
319
320
-
# License
320
+
# Running an Example Outside Gradle
321
+
322
+
Gradle simplifies running the examples, but what is needed to run an example (or your own code) outside of Gradle? We need to take similar steps to what Gradle would be doing:
323
+
- Start a JVM (Java Virtual Machine) to run the program.
324
+
- Make sure that the engine release sub-directories `bin` and `bin\x86` can be resolved via the `PATH` environment variable.
325
+
- Make sure your JAR can be resolved on the JVM classpath.
326
+
- Make sure the Nuix dependency JAR files in the engine release `lib` sub-directory can be resolved on the JVM classpath.
327
+
- Make sure we know the entry point to our program. The entry point is the Java class containing the `public static void main(String[] args)` method to run.
328
+
329
+
## Make Sure Java is Installed
330
+
It is assumed that you have Java installed and that running the command `java` on the console will succeed.
331
+
332
+
## `PATH` References to `bin` and `bin/x86`
333
+
You will need to make sure that the `PATH` environment variable for the JVM process points to the engine release sub-directories `bin` and `bin\x86`. This can be accomplished different ways. The easiest is to add those paths to the `PATH` environment variable. There are ways to set these temporarily for the JVM process you start. For example you could use a batch file and `SET LOCAL` / `END LOCAL` ([doc](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/setlocal)) in combination with `SET` ([doc](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/set_1)) or start your program via something like the .NET class [Process](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process?view=net-7.0) which allows for customizing the environment variables just for a process it starts via
java -cp "<Engine Lib Directory>/*;<Path to Jar>" <Main Class>
352
+
```
353
+
354
+
If my engine release `lib` directory is located at `C:\EngineRelease\lib`, my compiled JAR is located at `C:\MyApp\MyCustomNuixApp-v1.0.0.jar` and my `public static void main(String[] args)` method exists in a class `com.company.CustomNuixApp` then the command would look like this:
0 commit comments