Integrate the SDK
This article shows how to create a simple Maven project, integrate the Java SDK, and run the app.
Set up the development environment
Make sure your server meets the following requirements.
Hardware environment
Operating system
- Ubuntu (14.04 or higher)
- CentOS (6.6 or higher)
CPU architecture
- arm64
- x86-64
If you need to run the SDK on other architectures, submit a ticket to contact technical support.
Performance
- CPU:8-core, 1.8 GHz or higher.
- 2 GB of RAM or higher. 4 GB or higher is recommended.
Network
- The server is connected to the internet and has an internet IP.
- The server can access
*.agora.io
and*.agoralab.co
.
Software environment
- Apache Maven or other build tools. This page uses Apache Maven as an example.
- JDK 8
Get an Agora App ID and an Video SDK Temporary Token
See Get Started with Agora to learn how to get an Agora App ID and an Video SDK temporary token.
Create a Maven project
See Maven in Five Minutes to create a Maven project.
Integrate the SDK
-
Navigate to the
my-app
folder. -
Open
pom.xml
and replace the content with the following:
Implement a HelloWorld program
-
Navigate to
my-app/src
and remove thetest
folder. -
Navigate to
my-app/src/main/java/com/mycompany/app/App.java
and enter the following code. ReplaceYour Token
andYour App ID
with your Video SDK temporary token and App ID.The channel name you use to connect to the Video SDK channel must be the same as the one you use to generate your Video SDK temporary token. In the following code, the channel name is set to "test_channel". If you use a different channel name to generate your Video SDK temporary token, replace "test_channel" with your own channel name. -
Navigate to
my-app
. Create alib
folder, get the linux-sdk jar file from maven, and extract the files in thelib
folder. -
Navigate to
my-app
. Add thelib/native/linux/x86_64
folder to the LD_LIBRARY_PATH. -
Build the project:
-
Run the app:
The console prints the following information if the app runs successfully.