I'm trying to implement a synchronization with Google Calendar for a group project in Java.
In order to set up the Google Calendar API in our project, I followed Google's documentation here. Everything so far has worked apart from the the third and last task where I have to compile the sample code. When I try to run the command
gradle -q run
I get the message
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/xxxx/xxxx/xxxx/OurProject/src/main/java/util/Assertion.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
100 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
I've never worked with either gradle (we're using Maven for our project) and have no idea on what to do to be honest. I'm running this btw:
------------------------------------------------------------
Gradle 4.5
------------------------------------------------------------
Build time: 2018-01-24 17:04:52 UTC
Revision: 77d0ec90636f43669dc794ca17ef80dd65457bec
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM: 1.8.0_151 (Oracle Corporation 25.151-b12)
OS: Linux 4.13.0-25-generic amd64
edit:
The gradle.build as provided by Google:
apply plugin: 'java'
apply plugin: 'application'
mainClassName = 'Quickstart'
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '1.0'
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.api-client:google-api-client:1.23.0'
compile 'com.google.oauth-client:google-oauth-client-jetty:1.23.0'
compile 'com.google.apis:google-api-services-calendar:v3-rev287-1.23.0'
}
edit2: Here's a sample for one of the 100 errors:
error: cannot find symbol @Named
For this class:
import javax.enterprise.context.RequestScoped;
import java.awt.event.*;
import java.io.Serializable;
import java.awt.*;
import java.sql.Array;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.view.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
import javax.swing.*;
import javax.swing.text.html.HTML;
import java.io.Serializable;
import java.util.Map;
@Named
@RequestScoped
public class ModulBean extends AbstractBean implements Serializable {
//variables
public Modul getModul() {
return modul;
}
@Inject
public ModulBean(Session theSession, ModulDAO modulDao, UserDAO userDAO) {
super(theSession);
this.modulDao = modulDao;
this.userDAO = userDAO;
}
@PostConstruct
public void init() {
modul = new Modul();
allModuls = modulDao.getAllModuls();
allUsers = userDAO.getAllUsers();
}
public List<Modul> getAllModuls() {
return allModuls;
}
public void deleteLV(final Modul theModul) {
System.out.println("gelöscht" + theModul);
modulDao.remove(theModul);
init();
}
public void editLV(final Modul theModul) {
}
public void createLV() {
//creates an LV
}
}
}