java-12

ZonedDateTime change behavior jdk 8/11

≡放荡痞女 提交于 2020-01-12 10:28:19
问题 I am migrating an application from jdk 8 to 11 and I can see ZonedDateTime change is behavior about daylight saving time. JDK8 ZonedDateTime parse = ZonedDateTime.parse("2037-05-10T19:15:00.000+01:00[Europe/Paris]"); System.out.println(parse); output: 2037-05-10T19:15+02:00[Europe/Paris] JDK11/12 ZonedDateTime parse = ZonedDateTime.parse("2037-05-10T19:15:00.000+01:00[Europe/Paris]"); System.out.println(parse); 2037-05-10T20:15+02:00[Europe/Paris] Can someone explain to me why did they change

ZonedDateTime change behavior jdk 8/11

穿精又带淫゛_ 提交于 2020-01-12 10:27:12
问题 I am migrating an application from jdk 8 to 11 and I can see ZonedDateTime change is behavior about daylight saving time. JDK8 ZonedDateTime parse = ZonedDateTime.parse("2037-05-10T19:15:00.000+01:00[Europe/Paris]"); System.out.println(parse); output: 2037-05-10T19:15+02:00[Europe/Paris] JDK11/12 ZonedDateTime parse = ZonedDateTime.parse("2037-05-10T19:15:00.000+01:00[Europe/Paris]"); System.out.println(parse); 2037-05-10T20:15+02:00[Europe/Paris] Can someone explain to me why did they change

Java 12 JMeter 5 HTTP/2 request java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory

▼魔方 西西 提交于 2020-01-02 19:16:07
问题 I am using Java 12, JMeter 5.1.1 on Ubuntu 9.0.4 and bumps into the following exception when trying to send HTTP/2 request: Response code: Non HTTP response code: java.util.concurrent.ExecutionException Response message: Non HTTP response message: java.lang.IllegalStateException: No Client ALPNProcessors! And this stack trace in the response body: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: No Client ALPNProcessors! at org.eclipse.jetty.util.FuturePromise.get

Inferred type does not conform to equality constraint error for unrelated variables

こ雲淡風輕ζ 提交于 2020-01-01 05:08:47
问题 I have the following piece of code public class TeeingCollector { public static void main(String[] args) { // var strs = List.of("abc"); var dividedStrings = Stream.of("foo", "hello", "bar", "world") .collect(Collectors.teeing( Collectors.filtering((String s) -> s.length() <= 3, Collectors.toList()), Collectors.filtering((String s) -> s.length() > 3, Collectors.toList()), List::of )); System.out.println(dividedStrings); } private static class Employee { boolean isActive; public Employee

Compile and execute a JDK preview feature with Maven

吃可爱长大的小学妹 提交于 2019-12-28 02:07:12
问题 With JDK/12 EarlyAccess Build 10, the JEP-325 Switch Expressions has been integrated as a preview feature in the JDK. A sample code for the expressions (as in the JEP as well): Scanner scanner = new Scanner(System.in); Day day = Day.valueOf(scanner.next()); switch (day) { case MONDAY, TUESDAY -> System.out.println("Back to work.") ; case WEDNESDAY -> System.out.println("Wait for the end of week...") ; case THURSDAY,FRIDAY -> System.out.println("Plan for the weekend?"); case SATURDAY, SUNDAY -

Problem running tests with enabled preview features in surefire and failsafe

℡╲_俬逩灬. 提交于 2019-12-22 04:14:11
问题 I'm trying to migrate a project to Java 12, with --enable-preview . I added --enable-preview in compiler settings: <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> <configuration> <release>12</release> <compilerArgs> <arg>--enable-preview</arg> </compilerArgs> </configuration> </plugin> And also added it in argLine for surefire and failsafe: <properties> <argLine>--enable-preview</argLine> </properties> And do a mvn clean verify results in: [ERROR] Failed to

Eclipse 2019-03 is showing this message: JRE Oracle Corporation/12.0.1 is not supported, advanced source lookup disabled

假装没事ソ 提交于 2019-12-13 16:18:46
问题 I am using Eclipse 2019-03 (current version as of now) and JDK 12 on Windows 10. Whenever I run any code, it runs everything fine. However, it also shows a message colored red. This is the message I am getting: JRE Oracle Corporation/12.0.1 is not supported, advanced source lookup disabled Snapshot of the Eclipse console Is there something I can do or should just ignore it? Thank you... 回答1: You should install the Java 12 plugin for eclipse. Note that in eclipse 2019-06 and higher, that

Error occurred during initialization of boot layer when executing Selenium tests using TestNG and Java 12 through Eclipse

强颜欢笑 提交于 2019-12-12 06:58:09
问题 ErrorOccuredDuringInitializationofbootlayer I keep getting this error when I run my test: Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for C:\Users\Bonfire.eclipse\org.eclipse.platform_4.12.0_867647348_win32_win32_x86_64\plugins\com.beust.jcommander_1.72.0.jar Caused by: java.lang.IllegalArgumentException: com.beust.jcommander.1.72.0: Invalid module name: '1' is not a Java identifier How can I fix it? 回答1: Add TestNG

No such field exception while loading “scl” field from Classloader

时光怂恿深爱的人放手 提交于 2019-12-11 19:13:28
问题 I am moving my code from JDK 8 to Open JDK 12. While doing so, I am facing following issue : java.lang.NoSuchFieldException: scl while trying to call ClassLoader.class.getDeclaredField("scl"). This was working fine in Java 8 but no longer works in newer Java versions. I did some findings and believe it has got to do with the way working of reflection and use of internal Java packages have changed since Java 8. Set<URL> classLoaderUrls = computeClassLoaderUrls(); ClassLoader

Error:java: error: invalid source release: 13 using JDK12 with IntelliJ

浪尽此生 提交于 2019-12-07 06:58:24
问题 I am trying to build a project with JDK-12 ea. While trying to execute a sample class: public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int value = scanner.nextInt(); // After JEP-325 switch (value) { case 1 ->System.out.println("one"); case 2 ->System.out.println("two"); default ->System.out.println("many"); } } The IDE throws the error that reads Error:java: error: invalid source release: 13 Relevant project configuration screens : Module settings SDKs