These are resources for workshop about Byteman initially created for DevConf.CZ - Brno 2018.
The repository contains slides for the presentation and then directories for individual tasks that the workshop consists from (1, 2, 3, 5).
What you will need to have on your machine to get running particular tasks
-
Java JDK 8 (http://www.oracle.com/technetwork/java/javase/downloads/)
-
Byteman binaries (agent jar) (http://byteman.jboss.org/downloads.html)
-
Byteman programmer’s Guide (http://downloads.jboss.org/byteman/4.0.0/byteman-programmers-guide.html)
-
IDE (Eclipse, IntelliJ IDEA, …) will be helpful
You can use script setup.sh
to download binaries from the net for you and
settings the expected variables expected to be set in console for task completion.
-
cd byteman-workshop
-
source setup.sh
and follow the printed instructions
Warning
|
tested with bash, could not work with others (e.g. csh makes troubles) |
-
clone repository of this workshop
git clone https://github.com/ochaloup/byteman-workshop.git
-
export BYTEMAN_WORKSHOP="$PWD/byteman-workshop"
-
mkdir "$BYTEMAN_WORKSHOP/libs"
Warning
|
steps referred through the workshop instructions are relative
to the directory $BYTEMAN_WORKSHOP/libs .The libraries could be placed at whatever directory which fits for you. |
-
installing java
-
option 1:
dnf install java java-devel
-
option 2:
-
download java jdk (jdk-8u161) archive from https://www.java.com/en/download/linux_manual.jsp to
$BYTEMAN_WORKSHOP/libs
-
tar -C "$BYTEMAN_WORKSHOP/libs" -xzf "$BYTEMAN_WORKSHOP/libs/jdk-8u161-linux-x64.tar.gz"
-
export JAVA_HOME="$BYTEMAN_WORKSHOP/libs/jdk1.8.0_161"
-
export PATH="$JAVA_HOME/bin:$PATH"
-
-
-
installing Maven
-
option 1:
dnf install maven
-
option 2: download Maven archive to
$BYTEMAN_WORKSHOP/libs
-
wget http://www-eu.apache.org/dist/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.zip -O $BYTEMAN_WORKSHOP/libs/maven352.zip
-
unzip -d "$BYTEMAN_WORKSHOP/libs" "$BYTEMAN_WORKSHOP/libs/maven352.zip"
-
export MAVEN_HOME="$BYTEMAN_WORKSHOP/libs/apache-maven-3.5.2"
-
export PATH="$MAVEN_HOME/bin:$PATH"
-
-
to check Java and Maven are installed
mvn -version
-
-
download Byteman binaries (see http://downloads.jboss.org)
-
wget http://downloads.jboss.org/byteman/4.0.0/byteman-download-4.0.0-bin.zip -O "$BYTEMAN_WORKSHOP/libs/byteman400.zip"
-
unzip -d "$BYTEMAN_WORKSHOP/libs/" "$BYTEMAN_WORKSHOP/libs/byteman400.zip"
-
export BYTEMAN_HOME="$BYTEMAN_WORKSHOP/libs/byteman-download-4.0.0"
-
export BYTEMAN_JAR="$BYTEMAN_HOME/lib/byteman.jar"
-
to check that byteman jar exists
file "$BYTEMAN_JAR"
(expected output …: Java archive data (JAR)) orjava -jar "$BYTEMAN_JAR"
(expected output no main manifest attribute, in…)
-
-
compile java sources
cd $BYTEMAN_WORKSHOP; mvn install -DskipTests
Note
|
now you can find the Byteman programmer’s guide
at $BYTEMAN_WORKSHOP/libs/byteman-download-4.0.0/docs/byteman-programmers-guide.pdf
or published at http://downloads.jboss.org/byteman/4.0.0/byteman-programmers-guide.html
|
I’m sorry there is no precise instructions right now, see instructions for the Linux and adjust it for your purpose.
Note
|
Instruction for the installation and running the tasks were prepared and tested only for Linux. Feel free to contribute here :-) |
Note
|
on Windows instead of bash keyword export use cmd keyword set
|