Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在谷歌电子表格上书写_Java_Google Sheets - Fatal编程技术网

Java 在谷歌电子表格上书写

Java 在谷歌电子表格上书写,java,google-sheets,Java,Google Sheets,我正试图遵循这个谷歌的例子- 但是,当我运行时,它返回一个未经授权的401错误。在上面的链接中,它表示需要以下OAuth作用域之一: https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/spreadsheets 有人知道如何在java/gradle项目中包含这些作用域吗 谢谢 您需要添加auth,因为您需要经过身份验证才能

我正试图遵循这个谷歌的例子-

但是,当我运行时,它返回一个未经授权的401错误。在上面的链接中,它表示需要以下OAuth作用域之一:

https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/spreadsheets
有人知道如何在java/gradle项目中包含这些作用域吗


谢谢

您需要添加auth,因为您需要经过身份验证才能执行操作

进行身份验证时,需要请求要访问的作用域(权限)

此处提供了Auth教程