2023-12-19 15:19:13 +00:00
|
|
|
## Environment
|
|
|
|
|
|
|
|
```shell
|
|
|
|
export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_345`
|
|
|
|
export PATH="${JAVA_HOME}/bin:$PATH"
|
|
|
|
```
|
|
|
|
|
|
|
|
## Agent
|
2023-12-13 10:41:52 +00:00
|
|
|
|
|
|
|
### Compile the agent as JAR
|
|
|
|
|
|
|
|
```shell
|
2024-01-03 09:14:18 +00:00
|
|
|
export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_345`
|
|
|
|
export PATH="${JAVA_HOME}/bin:$PATH"
|
2023-12-13 10:41:52 +00:00
|
|
|
cd agent/src
|
2023-12-19 15:19:13 +00:00
|
|
|
find . -name '*.java' -print -exec javac -cp ../lib/\*:. -d ../../out/production/agent \{\} \;
|
2023-12-13 10:41:52 +00:00
|
|
|
cd ..
|
|
|
|
jar cfm agent.jar manifest.txt -C ../out/production/agent .
|
2024-01-03 09:14:18 +00:00
|
|
|
jar tf agent.jar
|
2023-12-13 10:41:52 +00:00
|
|
|
```
|
|
|
|
|
2023-12-19 15:19:13 +00:00
|
|
|
## Profiler
|
|
|
|
|
|
|
|
### Compile the profiler
|
|
|
|
|
|
|
|
```shell
|
2024-01-03 09:14:18 +00:00
|
|
|
export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_345`
|
|
|
|
export PATH="${JAVA_HOME}/bin:$PATH"
|
2023-12-19 15:19:13 +00:00
|
|
|
cd profiler/src
|
|
|
|
find . -name '*.java' -print -exec javac -d ../../out/production/profiler \{\} \;
|
|
|
|
cd ../..
|
|
|
|
```
|
|
|
|
|
2023-12-19 15:27:18 +00:00
|
|
|
## Application
|
|
|
|
|
|
|
|
### Compile the application
|
|
|
|
|
|
|
|
```shell
|
2024-01-03 09:14:18 +00:00
|
|
|
export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_345`
|
|
|
|
export PATH="${JAVA_HOME}/bin:$PATH"
|
2023-12-19 15:27:18 +00:00
|
|
|
cd application/src
|
|
|
|
find . -name '*.java' -print -exec javac -d ../../out/production/application \{\} \;
|
|
|
|
cd ../..
|
|
|
|
```
|
|
|
|
|
|
|
|
### Run application with agent
|
2023-12-13 10:41:52 +00:00
|
|
|
|
|
|
|
```shell
|
2024-01-03 09:14:18 +00:00
|
|
|
export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_345`
|
|
|
|
export PATH="${JAVA_HOME}/bin:$PATH"
|
2023-12-19 15:27:18 +00:00
|
|
|
java -javaagent:agent/agent.jar=hello -cp out/production/application -Xbootclasspath/p:out/production/profiler ch.usi.inf.sp.dbi.Application
|
2023-12-13 10:41:52 +00:00
|
|
|
```
|