java-10

Alternative to sslSocketFactory in Java10

回眸只為那壹抹淺笑 提交于 2020-08-19 07:31:27
问题 I am using OkHttp and I need to ignore SSL errors for application debugging. This used to work in Java 8. final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { @Override public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { } @Override public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { } @Override public java.security.cert

Install4j Java minimum version seems not functional

拥有回忆 提交于 2020-07-18 10:42:11
问题 We are using Install4j 7.0.6 and set the Java minimum version to "10.0.1". We are bundling a Java 10.0.1 into the media file. When we replace the included JVM with a Java 9 VM our Application still starts. Are we just missunderstanding the function for the Java minimum version or are we using the wrong version format or is it broken in Install4j 7.0.6? 回答1: The bundled JRE will always be used, regardless of the minimum version. The minimum applies to installed JREs that are checked by the

What's going on here: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test failed

孤人 提交于 2020-02-03 02:10:16
问题 After upgrading from Java 8 to 10, I can build, run tests and run the application in IntelliJ, but when I try to run mvn package I get this error from which I'm not managing to extract meaningful information about what's going on: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project dashmanserver: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test failed.: IllegalArgumentException -> [Help 1]

How to install JDK 10 under Ubuntu?

拈花ヽ惹草 提交于 2020-01-26 14:42:33
问题 How do I install Java Development Kit (JDK) 10 on Ubuntu? The installation instructions on Oracle's help center only explain how to download and extract the archive on Linux platform, without any system setup. 回答1: Update: JDK 11 Now Available sudo apt-get install openjdk-11-jdk For JDK 10 Option 1: Easy Installation (PPA) sudo add-apt-repository ppa:linuxuprising/java sudo apt-get update sudo apt-get install oracle-java10-installer Then set as default with: sudo apt-get install oracle-java10

How to install JDK 10 under Ubuntu?

二次信任 提交于 2020-01-26 14:42:21
问题 How do I install Java Development Kit (JDK) 10 on Ubuntu? The installation instructions on Oracle's help center only explain how to download and extract the archive on Linux platform, without any system setup. 回答1: Update: JDK 11 Now Available sudo apt-get install openjdk-11-jdk For JDK 10 Option 1: Easy Installation (PPA) sudo add-apt-repository ppa:linuxuprising/java sudo apt-get update sudo apt-get install oracle-java10-installer Then set as default with: sudo apt-get install oracle-java10

JDK 10 cannot import javax.xml.namespace in Eclipse

夙愿已清 提交于 2020-01-24 18:00:24
问题 It's very strange. I am moving a dynamic web project from Java 8 to Java 10. The last thing I cannot get the dependency resolved is the javax.xml.namespace.QName class. You can see in the attached screen shot, the QName class exist in JRE System Library, but the IDE keep complaining that QName cannot be resolved to a type. 回答1: Try to change the order of elements on your classpath. The JRE must be before the Maven Dependencies. That fixes the issue. My guess is that the Java 10 compiler

What type of token exactly is “var” in Java 10?

此生再无相见时 提交于 2020-01-19 09:32:24
问题 In the last issue of Heinz Kabutz's newsletter, #255 Java 10: Inferred Local Variables, it is shown that var is not a reserved word in Java 10, because you can also use var as an identifier: public class Java10 { var var = 42; // <-- this works } However, you cannot use i.e. assert as an identifier, as in var assert = 2 , because assert is a reserved word. As it's told in the linked newsletter, the fact that var is not a reserved word is good news, because this allows code from previous

Why can't we assign two inferred variables as an anonymous class to each other? [duplicate]

。_饼干妹妹 提交于 2020-01-14 02:56:21
问题 This question already has answers here : Can a local variable with an inferred type be reassigned to a different type? (2 answers) Closed 2 years ago . Java 10 allows to do an anonymous class with a var like: var a1 = new Object(){}; var a2 = new Object(){}; But this assignment will throw an error: a1 = a2; jshell> a1 = a2; | Error: | incompatible types: $1 cannot be converted to $1 | a1 = a2; | ^^ Based on the error log, why can't Java 10 assign two inferred var s as an anonymous class to

NoSuchMethodError in jna-platform

前提是你 提交于 2020-01-13 20:23:27
问题 I wanna make a new release of the application but when starting it it throws NoSuchMethodError java.lang.NoSuchMethodError: com.sun.jna.Native.load(Ljava/lang/String;Ljava/lang/Class;Ljava/util/Map;)Lcom/sun/jna/Library; at com.sun.jna.platform.win32.Shell32.<clinit>(Shell32.java:45) at com.sun.jna.platform.win32.Shell32Util.getFolderPath(Shell32Util.java:54) at com.sun.jna.platform.win32.Shell32Util.getFolderPath(Shell32Util.java:71) at com.faforever.client.preferences.PreferencesService.

Java 10 'var' and inheritance

回眸只為那壹抹淺笑 提交于 2020-01-12 19:08:51
问题 Following a review of the var feature as seen here: I have encountered difficulties with setting up my Eclipse/IntelliJ IDEA IDEs with JDK 10 and am therefore asking help from Stack Overflow users who have a working Java 10 environment. Consider the following: public class A { public void someMethod() { ... } } public class B extends A{ @Override public void someMethod() { ... } } ... ... ... var myA = new A(); // Works as expected myA = new B(); // Expected to fail in compilation due to var