You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class BT {
public static void main(String[] args) throws Exception {
//Replace client_id and client_secret with your own.
Translate.setClientId("shengday");
Translate.setClientSecret("goVdIz/l8fgAwWqYWdzK4RuHKloNoZ5Y5LFO7zMUEno");
// Translate an english string to spanish
String englishString = "Hello World!";
String spanishTranslation = Translate.execute(englishString, Language.SPANISH);
System.out.println("Original english phrase: " + englishString);
System.out.println("Translated spanish phrase: " + spanishTranslation);
}
}
On Windows I compiled with "javac -cp .\microsoft-translator-java-api-0.6.2-jar-with-dependencies.jar BT.java", where microsoft-translator-java-api-0.6.2-jar-with-dependencies.jar is downloaded from here.
Then I tried to run "java BT" and got the error message below, what did I do wrong?
Exception in thread "main" java.lang.NoClassDefFoundError: com/memetix/mst/translate/Translate
at BT.main(BT.java:7)
Caused by: java.lang.ClassNotFoundException: com.memetix.mst.translate.Translate
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
The text was updated successfully, but these errors were encountered:
I have BT.java:
import com.memetix.mst.language.Language;
import com.memetix.mst.translate.Translate;
public class BT {
public static void main(String[] args) throws Exception {
//Replace client_id and client_secret with your own.
Translate.setClientId("shengday");
Translate.setClientSecret("goVdIz/l8fgAwWqYWdzK4RuHKloNoZ5Y5LFO7zMUEno");
}
}
On Windows I compiled with "javac -cp .\microsoft-translator-java-api-0.6.2-jar-with-dependencies.jar BT.java", where microsoft-translator-java-api-0.6.2-jar-with-dependencies.jar is downloaded from here.
Then I tried to run "java BT" and got the error message below, what did I do wrong?
Exception in thread "main" java.lang.NoClassDefFoundError: com/memetix/mst/translate/Translate
at BT.main(BT.java:7)
Caused by: java.lang.ClassNotFoundException: com.memetix.mst.translate.Translate
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
The text was updated successfully, but these errors were encountered: