java-10

Java 10 (and following) on 32-Bit systems

独自空忆成欢 提交于 2019-12-19 05:48:30
问题 As far as I know there are no plans from oracle to ship java for 32 Bit - but maybe I misunderstand the situation. If I'm correct - what do we all do if we need to support 32-Bit libraries (dlls)? And whats about 32 Bit OSes out there? Currently this seems to be a huge impact in the future but as I said - maybe I'm wrong. Fact is that we can't download a Java 10 runtime in 32 Bit as there are only 64 Bit Download-Links. 回答1: Oracle is not the only party building and distributing OpenJDK. For

“array initializer needs an explicit target-type” - why?

本秂侑毒 提交于 2019-12-19 05:03:15
问题 Following JEP 286: Local-Variable Type Inference description I am wondering, what the reason is for introducing such a restriction, as: Main.java:199: error: cannot infer type for local variable k var k = { 1 , 2 }; ^ (array initializer needs an explicit target-type) So for me logically it should be: var k = {1, 2}; // Infers int[] var l = {1, 2L, 3}; // Infers long[] Because Java compiler can already infer properly the type of an array: void decide() { arr(1, 2, 3); // call void arr(int ..

Should I use var in Java 10? [closed]

混江龙づ霸主 提交于 2019-12-19 03:21:35
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . Given that I can't use var for non-denotable types(Nulls, Anonymous Classes, Some Single Method Class and most importantly Intersecting Types). Am I better off not using it for better readability and consistency (given that its only for local types)? I kind of feel that it

JShell access to variables defined outside of jshell instance

无人久伴 提交于 2019-12-19 02:49:07
问题 From inside jShell script, is it possible to access or register variables that are defined in code that's also creating JShell? Currently there seems to be no mechanism to either access or register a variable to Shell instance, or return none string types from inside JShell (like objects or lambda etc.) ex: import jdk.jshell.JShell; import jdk.jshell.JShellException; import jdk.jshell.SnippetEvent; import java.util.List; public class Main { public static void main(String[] args) throws

Failed to start Jenkins on macOs - Java 10

孤街浪徒 提交于 2019-12-18 16:48:17
问题 I'm trying to start Jenkins using: java -jar jenkins.war I got this error: java.lang.UnsupportedClassVersionError: 54.0 at Main.main(Main.java:128) This problem comes after an update of my development environment, I'd switched to : Java 10.0.1+10 Jenkins 2.107.2 MacOS 10.13.4 回答1: Based on the error message that you are getting: The JAR / WAR file being loaded was compiled for Java 10 (and later) because the message says that the classfile version is 54. The JRE that is actually being used is

How to uninstall JDK on Mac OS?

有些话、适合烂在心里 提交于 2019-12-18 11:25:43
问题 Folks - I am facing challenges while trying to uninstall JDK from my MAC (macOS High Sierra Version 10.13.4 - 17E199). I have two JDK instances installed and I want to uninstall both of them. I am following the steps listed on this page: https://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html I am trying to run this command in the /Library/Java/JavaVirtualMachines directory which throws an error that I do not have the permission. rm -rf jdk1.8.0_06.jdk I am the

Proper fix for Java 10 complaining about illegal reflection access by jaxb-impl 2.3.0?

↘锁芯ラ 提交于 2019-12-18 10:39:14
问题 We are looking at upgrading some legacy code to Java 10. As JAXB is not visible by default (EDIT: and the proper long term solution is not to circumvent the symptom using various JVM flags, but fix it properly) I have added this snippet to my pom.xml: <!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api --> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId>

Does Java 9 include Graal?

不羁的心 提交于 2019-12-17 23:17:32
问题 I'm reading JEP 317. It says that Graal (a new experimental Java-based JIT compiler) will be part of JDK 10, but then it says that is already available in JDK 9. So, what's the point of JEP 317 then? Does Java 9 include Graal or not? 回答1: From one of my memos, on linux-x64 (out-of-the-box) to use Graal on JDK 9, you can enable it using : -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler Source : Tweet from Chris. If you're explicitly willing to make use of the org

What is var in Java 10?

蓝咒 提交于 2019-12-14 03:29:27
问题 I was reading about the new features released in Java 10 and I found Java 10 introduced var as a reserve type name to reduce verbosity. It can be used as a variable, method, and package name, but we cannot use it as a class or interface name. Is var similar to the var keyword in JavaScript? What exactly are the similarities and the differences between Java's var and JavaScript's var ? 回答1: var serves a somewhat conceptually similar purpose in both languages, but there are important

How to run a Java 9 main class in Eclipse without editing a launch-configuration?

旧城冷巷雨未停 提交于 2019-12-12 19:30:33
问题 I created a simple Hello World main class and a module-info.java file within a Maven project in Eclipse Oxygen.1a Release (4.7.1a), running on Java 9.0.1. When I try to start the main class with right-click - Run As Java Application I get the error: Error occurred during initialization of boot layer java.lang.module.FindException: Module com.github.gv2011.quarry.modules.moda not found I can successfully run it from the command line from the target/classes directory: java -p . -m com.github