Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message #47

Open
shengday opened this issue May 22, 2013 · 0 comments
Open

Error message #47

shengday opened this issue May 22, 2013 · 0 comments

Comments

@shengday
Copy link

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");

// 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant