java-11

How to execute AWS lambda with Open JDK 11+ as custom runtime?

白昼怎懂夜的黑 提交于 2019-12-05 19:33:31
问题 AWS allows to create Lambda function with Java 8 (Open JDK 8) as runtime . I need to create a simple function using Open JDK 11 . Something like that: package example; import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.LambdaLogger; public class Hello { public String myHandler(int myCount, Context context) { LambdaLogger logger = context.getLogger(); logger.log("received : " + myCount); return String.valueOf(myCount); } } There is an option that

Java Play akka project migration from jdk8 to jdk11

你说的曾经没有我的故事 提交于 2019-12-05 18:09:45
I am trying to migrate the project which was built on jdk8 using play and Akka framework to jdk11. During the process, I am getting the below error. Could someone please let me know why is the error being thrown? Below are the versions I am using: JDK-11 SCala 2.12.8 Play 2.6.7 Akka 2.5.13 Exception: java.lang.NumberFormatException: Not a version: 11 at scala.util.PropertiesTrait$class.parts$1(Properties.scala:176) at scala.util.PropertiesTrait$class.isJavaAtLeast(Properties.scala:180) at scala.util.Properties$.isJavaAtLeast(Properties.scala:16) at play.dev.filewatch.FileWatchService$$anon$1

Java 11: Implementation of JAXB-API has not been found on module path or classpath

筅森魡賤 提交于 2019-12-05 17:10:43
I have a little project which does throw an exception when i let it run. The problem is here (TestObject.java): final JAXBContext jaxbContext = JAXBContext.newInstance(...); I really do not understand why this throws the exception. I also created a test which works like a charm (TestTest.java). Please forgive me the names, but this is just a small test application to get this working with java 11. I followed this: javax.xml.bind.JAXBException Implementation of JAXB-API has not been found on module path or classpath and added compile('javax.xml.bind:jaxb-api:2.3.0') compile('javax.activation

package sun.awt does not exist

做~自己de王妃 提交于 2019-12-05 16:58:53
When compiling with ant , calls to sun.awt.AppContext work, however the same code compiled with IntelliJ fails using AdoptOpenJDK11. sun.awt.AppContext with Oracle JDK8 works with IntelliJ sun.awt.AppContext with AdoptOpenJDK11 does NOT work with IntelliJ Although Sun/Oracle has warned for a while about avoiding the sun.* packages, there are certain features (bugs?) in Java that still require them and stranger, the command line seems happy. Sample code: package test; import javax.print.PrintService; import javax.print.PrintServiceLookup; import sun.awt.AppContext; public class Main { public

In jshell-11, why does a redeclared reference variable that resets to null still have a type?

北战南征 提交于 2019-12-05 14:15:27
问题 When redeclaring Integer 'a' in line 33, why does jshell show the reference variable as an instance of Integer (refer to lines 38 & 39)? After the redeclaration, line 34 shows that 'a' is set to null. When 'a' is declared in line 6 but not given a value, or reset to null in line 22, 'a' is not considered an instance of Integer. I would expect that when the reference variable is redeclared, since its value is null, that it would not be an instance of a type; however, that is not the case. 01:

JavaFX Integer Spinner (IntegerSpinnerValueFactory) does not wrap around the value to minimum

亡梦爱人 提交于 2019-12-05 13:37:25
I have created an Integer Spinner with values min (5), max (15) and initialValue (12) and wrapAround (true) . Once the spinner reaches the max (15) value during increment, instead of resetting the value to min (5) as it says in the documentation , it is being reset to value 10 (max (15) - min (5)) public final void setWrapAround​(boolean value) Sets the value of the property wrapAround. Property description: The wrapAround property is used to specify whether the value factory should be circular. For example, should an integer-based value model increment from the maximum value back to the

Patching java.base results in java.lang.LinkageError

北慕城南 提交于 2019-12-05 12:44:09
I am trying to do the same thing in Java 11 that could be done with -Xbootclasspath/p:path in pre java 9. As a simple example I modified one of the valueOf methods of java.lang.Integer and compiled the project with: javac --module-source-path=src/java.base --patch-module java.base=src/java.base -d mods $(find src -name '*.java') I then ran a simple sample using: java --patch-module java.base=<pathToMyModifiedJavaBaseClasses> -p lib -m my.moduleA/my.moduleA.Main That worked an I'm seeing the modifications displayed (a simple print out I did from valueOf ). When I try, however, to do the same

eclipse tycho + java 11 = Unknown OSGi execution environment: 'JavaSE-11'

怎甘沉沦 提交于 2019-12-05 11:52:47
How to build an eclipse RCP app based on Java 11 with tycho? I'm using eclipse 2018-09 RCP + the Java 11 plugin + OpenJDK 11 My application is plugin-based and in all the plugins, the MANIFEST.MF file contains: Bundle-RequiredExecutionEnvironment: JavaSE-11 The tycho build fails with the following exception: [ERROR] Internal error: org.eclipse.tycho.core.osgitools.OsgiManifestParserException: Exception parsing OSGi MANIFEST {...}\META-INF\MANIFEST.MF: Unknown OSGi execution environment: 'JavaSE-11' -> [Help 1] org.apache.maven.InternalErrorException: Internal error: org.eclipse.tycho.core

Sonar scanner with Maven and JDK 11

[亡魂溺海] 提交于 2019-12-05 10:23:28
I can make Sonar scanner work with OpenJDK 8 but not with OpenJDK 11. The Maven command used is: mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar -Dsonar.analysis.mode=preview -Dsonar.report.export.path=sonar-report.json -P ci The build fails with: [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project framework-bio: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar failed: A required class was missing while executing org.sonarsource.scanner.maven:sonar-maven

Switching to java 11 from java 8

流过昼夜 提交于 2019-12-05 10:20:06
I have downloaded and installed oraclejdk11 from oracle official site and modified PATH & JAVA_HOME variable in system environment variable on windows C:\Users\Aviral>javac -version javac 11.0.1 C:\Users\Aviral>java -version java version "1.8.0_102" Java(TM) SE Runtime Environment (build 1.8.0_102-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode) i know that jdk11 do not contain jre but how can i run a java program from cmd in java 11 bin folder contains all the traditional JRE tools. In Java 11, both JDK and JRE tools are consolidated so that there is no JRE within JDK 11.