0

Github: https://github.com/huymluu/yandex-translate-api

I would like to use this API in my project, as I tried multiple Yandex API wrapper for java, although I get this error: java.lang.ClassNotFoundException: yandexAPI.YandexException(https://github.com/Bumbleboss/yandexTranslate_api this error I got when I used that project.). So my question is, how can I fix the error, or make a jar from the project https://github.com/huymluu/yandex-translate-apiso I can try that in my project! Thanks!

CODE:

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;

    }

1 Answers1

0

In the github there is in the Download part the "Latest version" Here you can download the yandexTranslate_api-1.4-withDependencies. You need to import it into your library. If you use Eclipse here is the methode.

DrHelmholtz
  • 30
  • 2
  • 10
  • Thank you! Although I have done this (Intellij), I downloaded the with dependencies one added this to my project and created this code.(look at the main post), it doesn't show any errors in the idea nor while compiling, although when I run it, it throws the error in the console. – Sem Jong de May 06 '20 at 12:44