Tag: java 9

Docker容器中的Java 9 Tomcat 9无法远程debugging

我有一个基于opendjdk:8-slim的Docker容器opendjdk:8-slim和已安装的Tomcat 9,我正在debugging从我的IDE(IntelliJ)部署的应用程序 – IDE在Docker主机上运行。 我使用以下configuration运行Tomcat CATALINA_OPTS="-Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=49520 \ -Dcom.sun.management.jmxremote.rmi.port=49520 \ -Dcom.sun.management.jmxremote.ssl=false \ -Dcom.sun.management.jmxremote.authenticate=false \ -Dcom.sun.management.jmxremote.local.only=false \ -Djava.rmi.server.hostname=10.0.75.1 \ -agentlib:jdwp=transport=dt_socket,address=49540,suspend=n,server=y" 一切都很好 – 我可以将IDE连接到容器。 另外,以下命令可以工作(从docker主机执行) – 它可以连接到容器中的进程(容器中的端口49540映射到主机上的端口49540): docker-host$ telnet localhost 49540 现在我想升级到Java 9.我把基本镜像从openjdk:8-slim改成了openjdk:9-slim ,我无法连接到docker主机的debugging器端口。 同样从IDE,我得到SocketTimeoutException: Connection reset 。 但是,从容器内部我可以通过telnet连接到debugging器。 我尝试了几个来自openjdk仓库的Java 9镜像,还有其他的仓库,比如说adenix/java ,但是不幸的是结果是一样的。

使用docker运行Java 9应用程序不起作用 – UnsupportedClassVersionError

我将我的应用程序从Java 8更改为Java 9.将Windows系统环境variables(path)和JAVA_HOME更改为Java 9(jdk-9.0.1)。 在IDE(IntelliJ)中运行应用程序时,它工作正常。 它也编译没有问题与sbt。 只用docker运行应用程序是行不通的。 应用程序似乎用Java 9成功编译,但是docker试图用Java 8来运行它(这是我从exception消息中读取的)。 命令: sbt docker:publish docker run –rm -p 9000:9000 eu.gcr.io/the-repository-name/the-image-name:1.0 我得到以下错误: Exception in thread "main" java.lang.UnsupportedClassVersionError: Module has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to […]

Docker和Java 9模块

有特定Java 9模块的Docker镜像吗? 我猜应该会出现FROM java:9基本映像,但是如果我的基础是来自最小的Java 9核心模块,那么可选模块将如何来。

Docker中的Java 9 ProcessHandle API:PID值和可见进程的差异

在简单的“Dockerized”Java程序中尝试使用Java 9中的新ProcessHandle API时,在检索正在运行的进程的进程ID时,我发现在行为方面存在差异。 特别是在调用方法ProcessHandle.pid() , Docker上生成的PID与主机上显示的本机ID不同 ,尽pipe文档说该方法“返回进程的本机进程ID”。 另外, ProcessHandle.allProcesses()的结果是有区别的。 为了演示,下面的程序执行以下操作: 打印当前进程的PID, 产生一个睡眠几秒钟的subprocess(以允许打印其信息), 最后打印所有可见的进程。 public static void main(String[] args) { System.out.println("### Current process info ###"); ProcessHandle currentProcess = ProcessHandle.current(); printInfo(currentProcess); System.out.println(); // Fork a child process that lasts for a few seconds spawnProcess("jshell –startup ./sleep.txt"); printAllVisibleProcesses(); } private static void printAllVisibleProcesses() { System.out.println("### Visible processes info […]

OpenJDK9(Docker),分级4.2.1,GitLab

我的项目使用graddlew 4.2.1在本地构build。 但是当我把它推到GitLab,我得到下面的错误。 我必须使用Docker,所以我不知道我可以使用这个Docker Image来工作。 这也是gitlab-ci.yml: # This file is a template, and might need editing before it works on your project. # This template uses the java:8 docker image because there isn't any # official Gradle image at this moment # # This is the Gradle build system for JVM applications # https://gradle.org/ # […]