简体   繁体   中英

The import com.google cannot be resolved

I am just trying out the Google calendar APIs using rest calls. I do not intend to make an android app out of it right now. I followed the steps mentioned in https://developers.google.com/google-apps/calendar/setup and got stuck when I tried importing. Steps I followed : 1. Made a console app project in Eclipse. 2. Made a java app project - JRE 1.8.0_25 3. Downloaded the zips from mentioned location in the calendar setup description. 4. In java build path in eclipse, I created 4 libraries(user) and in native library location added path to the unzipped lib folders. 5. made imports -

import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.jackson.JacksonFactory;
import com.google.api.services.calendar.Calendar;
import com.google.api.services.calendar.model.*;

and got the error : The import com.google cannot be resolved

I tried to go over all the previously asked questions - nothing helped.

These steps are not needed:

  1. Downloaded the zips from mentioned location in the calendar setup description.
  2. In java build path in eclipse, I created 4 libraries(user) and in native library location added path to the unzipped lib folders.

What you need to do instead is:

download the core Java client library and the Google Calendar API Java library .jar files and include them in your build path.

So no ZIP (but .jar), and simply add them to the build path (not as a native location but as Libraries/add JARs).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM