你如何禁用" $ HOME / .java_usagetracker"从被创造?

时间:2018-04-17 22:17:06

标签: java

根据Java的文档:

https://docs.oracle.com/javacomponents/usage-tracker/overview/toc.htm#JSUTO-GUID-6642AAD5-85A1-462F-9D77-09A52DF72404

默认情况下应禁用Java Usage Tracker。但Java 8u161或更高版本的情况并非如此。

1 个答案:

答案 0 :(得分:1)

com.oracle.usagetracker.track.last.usage=false中设置/etc/oracle/java/usagetracker.properties可以解决问题。

Dockerfile示例:

FROM centos:7

ARG JAVA_VERSION=8u171
ARG JAVA_BUILD=b11
ARG JAVA_HASH=512cd62ec5174c3487ac17c61aaa89e8

ENV JAVA_HOME=/usr/java/default

RUN mkdir /usr/java \
  && curl --create-dirs -L --retry 2 --retry-delay 2 --connect-timeout 30 \
     --cookie "oraclelicense=accept-securebackup-cookie;gpw_e24=http://edelivery.oracle.com" \
     http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION}-${JAVA_BUILD}/${JAVA_HASH}/jdk-${JAVA_VERSION}-linux-x64.rpm \
     -o /tmp/jdk-linux-x64.rpm \
  && rpm -ivh /tmp/jdk-linux-x64.rpm \
  && rm -f /tmp/jdk-linux-x64.rpm \
  && mkdir -p /etc/oracle/java/ \
  && echo "com.oracle.usagetracker.track.last.usage=false" > /etc/oracle/java/usagetracker.properties