- You need ROOT installed on your computer, and
root-configlocation should be in your PATH environment variable. You can check it by runningroot-configin 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_HOMEenvironment variable. You should be able to findjni.handjni_md.hin your$JAVA_HOME/includelocation. - Clone the repo, run scons, run maven:
git clone [email protected]:drewkenjo/j2root.git
cd j2root
mvn package
scons build/native
scons
- Set environment variables:
source setup.shin bashsource setup.cshin 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])