You need to enable JavaScript to run this app.
文档中心
AI MediaKit

AI MediaKit

复制全文
下载 pdf
Java SDK
初始化
复制全文
下载 pdf
初始化

Java SDK 可通过 Access Key 初始化。您可以根据需求选择设置 AK/SK 的方法。本文为您介绍初始化的操作步骤。

前置条件

初始化

智能处理支持的区域:华北 cn-north-1

AK/SK 设置方法

支持 3 种 AK/SK 的设置方法。

  • 方法一:在代码中设置
impService.setAccessKey("ak");
impService.setSecretKey("sk");
  • 方法二:在环境变量中设置
VOLC_ACCESSKEY="ak"
VOLC_SECRETKEY="sk"
  • 方法三:在文件中设置

在本地的 ~/.volc/config 中添加如下内容:

{
   "ak":"Your-AK",
   "sk":"Your-SK"
}

初始化代码

package com.volcengine.example;

import com.volcengine.service.imp.IImpService;
import com.volcengine.service.imp.impl.ImpServiceImpl;

public class Demo {

    public static void main(String[] args) throws Exception {
        IImpService impService = ImpServiceImpl.getInstance();

        // call below method if you don't set ak and sk
        impService.setAccessKey("your ak");
        impService.setSecretKey("your sk");
        // then call special actions
    }
}
最近更新时间:2023.11.14 10:47:35
这个页面对您有帮助吗?
有用
有用
无用
无用