MahmutKarali / google-api-translate-java

Automatically exported from code.google.com/p/google-api-translate-java
0 stars 0 forks source link

Error in translation #44

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have used the google-api-translate-java for translation.
In eclipse i have created a java project added the jar file to my project
and tested the example u have given .

This is my code :

import com.google.api.translate.Language;
import com.google.api.translate.Translate;

public class TranslatorDemo 
{
     public static void main(String[] args) 
     {
            try 
            {
              String translatedText = Translate.translate("Salut le monde",
Language.FRENCH, Language.ENGLISH);
              System.out.println(translatedText);
            } 
            catch (Exception ex) 
            {
              ex.printStackTrace();
            }
     }
}

The Error i got is :

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad
version number in .class file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at com.vsoftcorp.suvikas.TranslatorDemo.main(TranslatorDemo.java:13)

Please do help me

Original issue reported on code.google.com by LAXMI.MA...@gmail.com on 27 Feb 2009 at 12:49

GoogleCodeExporter commented 8 years ago
And i am using JDK 1.5 

Original comment by LAXMI.MA...@gmail.com on 27 Feb 2009 at 12:52

GoogleCodeExporter commented 8 years ago
Looks like I might have compiled the last release against 1.6 again, sorry.

The next release should be out shortly and I'll double check it's against 1.5.

Original comment by rich.mid...@gmail.com on 27 Feb 2009 at 6:35