- You need ROOT installed on your computer, and
root-config
location should be in your PATH environment variable. You can check it by runningroot-config
in your command line - The JDK introduces a bridge between the bytecode running in our JVM and the native code. So you need JNI header files accessible in the system default header locations or specify
JAVA_HOME
environment variable. You should be able to findjni.h
andjni_md.h
in your$JAVA_HOME/include
location. - Clone the repo, run scons, run maven:
git clone git@github.com:drewkenjo/j2root.git
cd j2root
mvn package
scons build/native
scons
- Set environment variables:
source setup.sh
in bashsource setup.csh
in csh
run-groovy root.groovy
https://github.com/drewkenjo/j2root/wiki
If your tree contains more than 250 branches your code can fail with this error
Caught: java.lang.IllegalArgumentException: array length is not legal: java.lang.IllegalArgumentException: array length is not legal:
The reason is because the length of the varargs is limited, and groovy fails when you pass too many arguments in fill
method.
The solution is to use List in the fill
method instead of varargs.
Instead of:
tree.Fill(0,1,2,3,4,5,6)
use:
tree.Fill([0,1,2,3,4,5,6])