The Java SDK v1 provides a low level API to call Arvados from Java.
ARVADOS_API_TOKEN: API client token to be used to authorize with API server. ARVADOS_API_HOST: Host name of the API server. ARVADOS_API_HOST_INSECURE: Set this to true if you are using self-signed certificates and would like to bypass certificate validations.
$cd $ARVADOS_HOME/sdk/java
$mvn -Dmaven.test.skip=true clean package
This will generate arvados sdk jar file in the target directory
$ARVADOS_HOME/sdk/java/ArvadosSDKJavaExample.java
is a simple program$ARVADOS_HOME/sdk/java/ArvadosSDKJavaExampleWithPrompt.java
can bePlease use these implementations to see how you would use the SDK from your java program.
Also, refer to $ARVADOS_HOME/arvados/sdk/java/src/test/java/org/arvados/sdk/java/ArvadosTest.java
for more sample API invocation examples.
Below are the steps to compile and run these java program.
call
requests.
$ javac -cp $ARVADOS_HOME/sdk/java/target/arvados-sdk-1.1-jar-with-dependencies.jar \
ArvadosSDKJavaExample*.java
This results in the generation of the ArvadosSDKJavaExample*.class files
in the same directory as the java files
$java -cp .:$ARVADOS_HOME/sdk/java/target/arvados-sdk-1.1-jar-with-dependencies.jar \ ArvadosSDKJavaExample
$java -cp .:$ARVADOS_HOME/sdk/java/target/arvados-sdk-1.1-jar-with-dependencies.jar \ ArvadosSDKJavaExampleWithPrompt
$ARVADOS_HOME/sdk/java/log/arvados_sdk_java.log
log4j.properties
file to change name and location of the log file.$nano $ARVADOS_HOME/sdk/java/src/main/resources/log4j.properties
and modify thelog4j.appender.fileAppender.File
property as needed. Rebuild the SDK: $mvn -Dmaven.test.skip=true clean package
eclipse project
M2_REPO
classpath variable in eclipse to point to your local repository.$HOME/.m2/repository
.In Eclipse IDE: Window -> Preferences -> Java -> Build Path -> Classpath Variables Click on the "New..." button and add a new M2_REPO variable and set it to your local Maven repository
In Eclipse IDE: File -> Import -> Existing Projects into Workspace -> Next -> Browse and select $ARVADOS_HOME/sdk/java
The content of this documentation is licensed under the
Creative
Commons Attribution-Share Alike 3.0 United States licence.
Code samples in this documentation are licensed under the
Apache License, Version 2.0.