views:

507

answers:

3

Dear all,

I am now going to use the .jar file on http://code.google.com/p/google-api-translate-java/

However,after I download it ,I tried to import it in my current project folder(in Eclipse)

the two import statements

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

always get complained by the compiler saying couln't find such class

could any one help on how to correctly import this .jar file into a project in Eclipse? Thanks.

Robert

+2  A: 

You need to add it to your build path. Right-click on the project in Project View, select Build Path->Configure Build Path, then Libraries tab. Now, use one of available options there to add a JAR.

Use "Add JAR" if you copied the jar to your project folder or "Add External JARs" to add it by poiting to a path in filesystem. (Anyway, it is better to copy the jar to the project folder, in which you want to use the jar).

HTH

pajton
+1  A: 

Copy the google-api-translate-java-0.92.jar file to your project /WEB-INF/lib/ folder and refresh your project (right click on project and select "refresh").

The Elite Gentleman