java-10

Why am I getting an AssertionError when assigning Arrays.asList() to var directly?

℡╲_俬逩灬. 提交于 2019-12-03 09:28:34
I'm trying to understand local variable type inference in Java 10. The code below works perfectly during compilation and runtime: List list1 = Arrays.asList(1L, 2.0F, "3"); var list2 = list1; However, this line throws a compilation error: var list3 = Arrays.asList(1L, 2.0F, "3"); Error:java: java.lang.AssertionError: Unexpected intersection type: java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>> I don't really understand why the 2nd case is wrong but not the 1st case. Because I expect the compiler would infer the

JVM 10 specification with diffs?

荒凉一梦 提交于 2019-12-03 06:33:47
Does anyone know if there is a version of the Java 10 and JVM 10 specifications with diffs from the previous version available? For Java 8 and Java 9, there were specifications with diffs, and it's very difficult to see what exactly changed otherwise. For differences between Java 9 and Java 10 (18.3), you can download " JSR-000383 Java SE 10 (18.3) Final Release Annex 3 for Evaluation " with the following link: http://download.oracle.com/otndocs/jcp/java_se-10-final-eval-spec/index.html Keep in mind, you must accept the Software License Agreement to download it. This archive contains the

Why can't the var keyword in Java be assigned a lambda expression?

核能气质少年 提交于 2019-12-03 05:23:45
问题 It is allowed to assign var in Java 10 with a string like: var foo = "boo"; While it is not allowed to assign it with a lambda expression such as: var predicateVar = apple -> apple.getColor().equals("red"); Why can't it infer a lambda or method reference type when it can infer the rest like String , ArrayList , user class, etc.? 回答1: From the Local-Variable Type Inference JEP: The inference process, substantially, just gives the variable the type of its initializer expression. Some subtleties

Can't link to JDK10 in Javadoc comments

故事扮演 提交于 2019-12-03 04:54:00
问题 After upgrading from Java 9 to 10, links to the JDK no longer work when generating documentation with the Javadoc tool (e.g., for a file importing java.util.Optional , {@link Optional} renders as Optional instead of as Optional; same issue with @see , @param , @return , and anywhere else you normally see Javadoc links). I have a simple modularized project, and I'm using Maven with the Javadoc plugin ( source and target options set to 10 in the configuration section for the compiler plugin).

Why Oracle JDK 9 download ends so early?

喜夏-厌秋 提交于 2019-12-03 03:55:01
问题 I wanted to install JDK 9 on my machine, visited JDK official download page, and was surprised to see, Java SE 9 has reached end of support. Users of Java SE 9 should switch to Java SE 10. Please visit our Java SE Downloads page to get the current version of Java SE. You will be redirected to the Java SE Downloads page in ... seconds. Please update your bookmarks to the Java SE Downloads page. I did some googling and Java release history etc. But couldn't find any concrete reason. I have

Why Oracle JDK 9 download ends so early?

筅森魡賤 提交于 2019-12-02 18:12:06
I wanted to install JDK 9 on my machine, visited JDK official download page, and was surprised to see, Java SE 9 has reached end of support. Users of Java SE 9 should switch to Java SE 10. Please visit our Java SE Downloads page to get the current version of Java SE. You will be redirected to the Java SE Downloads page in ... seconds. Please update your bookmarks to the Java SE Downloads page. I did some googling and Java release history etc. But couldn't find any concrete reason. I have couple of questions- Oracle is still supporting the JDK 1.8, but stopped releasing updates to JDK 9, why?

How to avoid IntelliJ to reset language level?

☆樱花仙子☆ 提交于 2019-12-01 18:54:15
I am having troubles with this which have been answered dusin of times on this site. My take on the problem is a bit different. I have a project which builds fine using maven 3.5.x and java release 10 (configured in the maven-compiler-plugin) When looking in IntelliJ's project structure, all modules have language level 10 (but the projects settings is language level 6 and the chosen sdk in the project structure is 1.8... However, even if I change the sdk to java 10 and the projects language level to 10, the error pasted below still occurs... ???? My IntelliJ version: IntelliJ IDEA 2018.2.5 To

exception in thread main java.lang.exceptionininitializerError When installing spark without hadoop

佐手、 提交于 2019-12-01 17:09:13
问题 I am trying to install spark2.3.0, more specificly, it is spark-2.3.0-bin-hadoppo2.7 'D:\spark\bin' is already added in environment variable PATH. Meanwhile, JDK-10 is installed. Hadoop is not installed. But google says spark can work without hadoop. Here is the error message C:\Users\a>spark-shell Exception in thread "main" java.lang.ExceptionInInitializerError at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:80) at org.apache.hadoop.security.SecurityUtil

exception in thread main java.lang.exceptionininitializerError When installing spark without hadoop

守給你的承諾、 提交于 2019-12-01 17:08:38
I am trying to install spark2.3.0, more specificly, it is spark-2.3.0-bin-hadoppo2.7 'D:\spark\bin' is already added in environment variable PATH. Meanwhile, JDK-10 is installed. Hadoop is not installed. But google says spark can work without hadoop. Here is the error message C:\Users\a>spark-shell Exception in thread "main" java.lang.ExceptionInInitializerError at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:80) at org.apache.hadoop.security.SecurityUtil.getAuthenticationMethod(SecurityUtil.java:611) at org.apache.hadoop.security.UserGroupInformation.initialize

Swing Issue on Java 10

隐身守侯 提交于 2019-12-01 11:46:57
I am currently trying to move our application from Java 8 to Java 10 and in few months will be moving to Java 11. We have a legacy system which uses a bit of API's which are removed or will be removed I guess. We are using ant script (1.10.1) for our application compilation. Below is the same of the part that build our application: <target name="javac-setup" depends="flags, with.clover, jaxb-apply, flamingo.javac"/> <target name="javac" depends="javac-setup"> <mkdir dir="${workmanager.dir.classes}"/> <javac destdir="${workmanager.dir.classes}" deprecation="on" debug="${javac.debug}" encoding=