Skip to content

Commit 3d1c716

Browse files
authored
chore: update windows karaf env step (#488)
Signed-off-by: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com>
1 parent 6e3fe93 commit 3d1c716

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ wget https://keploy-enterprise.s3.us-west-2.amazonaws.com/agent-jars/org.jacoco.
2828

2929
## Step 2: Configure Apache Karaf
3030

31-
### Update `JAVA_OPTS` for linux/mac in `setenv` File
31+
### Update `JAVA_OPTS` for Linux/Mac in `setenv` File
3232

3333
1. Navigate to the `bin` directory of your Apache Karaf installation.
3434
2. Open the `setenv` file for editing.
@@ -39,20 +39,28 @@ wget https://keploy-enterprise.s3.us-west-2.amazonaws.com/agent-jars/org.jacoco.
3939
export JAVA_OPTS="$JAVA_OPTS -javaagent:/path/to/org.jacoco.agent-0.8.12-runtime.jar=address=*,port=36320,destfile=jacoco-it.exec,output=tcpserver"
4040
```
4141

42-
### Update `JAVA_OPTS` for windows in `setenv.bat` File
42+
### Update `JAVA_OPTS` for Windows in `setenv.bat` File
4343

4444
1. Navigate to the `bin` directory of your Apache Karaf installation.
4545
2. Open the `setenv.bat` file for editing.
4646
3. Add the paths of the downloaded agents under the `JAVA_OPTS` section. For example:
4747

48-
```bash
49-
set JAVA_OPTS=-javaagent:/path/to/KeployAgent.jar
50-
set JAVA_OPTS=%JAVA_OPTS% -javaagent:/path/to/org.jacoco.agent-0.8.12-runtime.jar=address=*,port=36320,destfile=jacoco-it.exec,output=tcpserver
48+
```bat
49+
set JAVA_OPTS=-javaagent:/path/to/KeployAgent.jar
50+
set JAVA_OPTS=%JAVA_OPTS% -javaagent:/path/to/org.jacoco.agent-0.8.12-runtime.jar=address=*,port=36320,destfile=jacoco-it.exec,output=tcpserver
5151
```
5252

53-
**Note**: Windows support is not thoroughly tested. It is recommended to use macOS or Linux for better stability and compatibility.
53+
### Set Environment Variables as Java System Properties on Windows
54+
55+
On Windows, all environment variables should be passed as `-D` system properties for Java. Update the `JAVA_OPTS` section in `setenv.bat` to include the required variables. For example:
56+
57+
```bat
58+
set JAVA_OPTS=%JAVA_OPTS% -DAPI_KEY=xRp5nyiQ+B6yltBUpw==
59+
set JAVA_OPTS=%JAVA_OPTS% -DKEPLOY_MODE=RECORD
60+
set JAVA_OPTS=%JAVA_OPTS% -javaagent:/path/to/org.jacoco.agent-0.8.12-runtime.jar=address=*,port=36320,destfile=jacoco-it.exec,output=tcpserver
61+
```
5462

55-
Replace `/path/to/` with the actual paths where you downloaded the JAR files.
63+
Replace the placeholder values with actual paths and keys as needed.
5664

5765
### Update `config.properties`
5866

0 commit comments

Comments
 (0)