Skip to content

Commit

Permalink
AWS: Fix CLASSPATH to prevent NULL entry
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSerth committed Oct 11, 2024
1 parent 9a04b95 commit 8b5e7ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deploy/aws/java11Exec/src/main/java/poseidon/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ public APIGatewayProxyResponseEvent handleRequest(final APIGatewayV2WebSocketEve
ProcessBuilder pb = new ProcessBuilder(cmd);
pb.directory(workingDirectory);
Map<String, String> env = pb.environment();
env.put("CLASSPATH", ".:/var/task/lib/org.hamcrest.hamcrest-3.0.jar:/var/task/lib/junit.junit-4.13.2.jar:" + env.get("CLASSPATH"));
if (env.containsKey("CLASSPATH")) {
env.put("CLASSPATH", ".:/var/task/lib/org.hamcrest.hamcrest-3.0.jar:/var/task/lib/junit.junit-4.13.2.jar:" + env.get("CLASSPATH"));
} else {
env.put("CLASSPATH", ".:/var/task/lib/org.hamcrest.hamcrest-3.0.jar:/var/task/lib/junit.junit-4.13.2.jar");
}
Process p = pb.start();
InputStream stdout = p.getInputStream(), stderr = p.getErrorStream();
this.forwardOutput(p, stdout, stderr);
Expand Down

0 comments on commit 8b5e7ff

Please sign in to comment.