我如何才能把这个jarapi放到我的项目中?

问题描述 投票:0回答:1

Github.comhuymluuyandex-translate-api https:/github.comhuymluuyandex-translate-api。

我想在我的项目中使用这个API,因为我尝试了多个Yandex API包装器的java,虽然我得到了这个错误。java.lang.ClassNotFoundException: yandexAPI.YandexException(https:/github.comBumblebossyandexTranslate_api。 当我使用该项目时,我得到了这个错误)。) 所以我的问题是,我怎样才能修复这个错误,或者从项目中制作一个jar。https://github.com/huymluu/yandex-translate-api所以我可以在我的项目中尝试一下! 谢谢!

代码。

public String Translate(String text){

        String translatedText = "";
        YandexAPI api = new YandexAPI("APIKEY");


        try {
            translatedText = (api.getYandexResponse(text, YandexLanguage.Dutch).getText().get(0));
        } catch (YandexException e) {
            e.printStackTrace();
        }


        return translatedText;

    }
java api github jar yandex
1个回答
0
投票

在github中,下载部分有 "最新版本" 在这里,您可以下载 yandexTranslate_api-1.4-withDependencies。你需要把它导入到你的库中。如果你使用Eclipse 此处 乃阴极。

© www.soinside.com 2019 - 2024. All rights reserved.