0

情况:在 azure 管道的构建过程中,我在自托管代理上使用 JavaToolInstaller,并将“java/JAVA_HOME_8_x64_”放在目录中
背景:当我对该目录应用完全权限时,我不认为这是权限问题并为构建过程创建它
评估:以前有人见过这个问题吗?

重现步骤 - 托管现场代理

JavaToolInstaller

- task: JavaToolInstaller@0
  inputs:
    versionSpec: '8'
    jdkArchitectureOption: 'x64'
    jdkSourceOption: 'LocalDirectory'
    jdkFile: '/opt/jdk-8u251-linux-x64.tar.gz'
    jdkDestinationDirectory: '/opt/java'
    cleanDestinationDirectory: true
  condition: eq( variables['Agent.OS'], 'Linux' )

构建过程中出错

Cleaning destination folder before extraction: /opt/java
Retrieving the JDK from local path.
##[warning]Can\'t find loc string for key: ExtractingArchiveToPath
ExtractingArchiveToPath /opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz
Creating destination folder: /opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz
##[error]Unable to create directory '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'. EACCES: permission denied, mkdir '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'
##[error]Unable to create directory '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'. EACCES: permission denied, mkdir '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'
Finishing: JavaToolInstaller
4

1 回答 1

0

根据错误信息,您似乎没有写入此文件的权限。请检查并确保您对该文件夹具有 w 和 r 权限

脚步:

找到文件jdk-8u251-linux-x64.tar.gz->右击图标->选择属性->点击选项卡权限然后检查账户权限

或者使用cmdls –l {file name}查看文件夹权限,然后运行cmd chmod [permission] [file_name]更新权限

有关详细信息,请参阅此链接:如何在 Linux 中更改目录权限

于 2020-08-17T09:44:59.033 回答