java-10

IntelliJ IDEA no code completion for Java 10 'var'?

六眼飞鱼酱① 提交于 2019-11-30 20:36:16
Recently I installed the new version (2018.1) of IntelliJ IDEA, which added support for Java 10. But when I trying to use the var (for local variable type inference), I found there was no var in the code completion list. (See the screenshot below) If I continue typing, it will apply VarHandle as the first suggestion in that list. Then I have to undo that completion to restore var . I have checked project settings, I use JDK 10 and the language level is also set to 10. Code like var number = 1; compiles well. And I couldn't find anything about this in IDE settings. What am I doing wrong? I just

How to use Java11 (Java10) with Eclipse Plugin?

南笙酒味 提交于 2019-11-30 14:16:15
If I specify JavaSE-10 as minimum execution environment in my Eclipse plugin: I get following errors when starting my plugin as Eclipse Application: org.osgi.framework.BundleException: Could not resolve module: org.treez.core [597] Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=10))" Unresolved requirement: Require-Bundle: org.treez.javafxd3; visibility:="reexport" -> Bundle-SymbolicName: org.treez.javafxd3; bundle-version="1.0.0.qualifier"; singleton:="true" org.treez.javafxd3 [586] Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi

Failed to start Jenkins on macOs - Java 10

孤街醉人 提交于 2019-11-30 14:08:07
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 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 Java 9 or earlier. If you were using Java 10, it would be happy with version 54. In other words, despite

findResource(“”) returning null when module-info.java is present, why is that?

大城市里の小女人 提交于 2019-11-30 10:41:51
I'm debugging why in the presence of module-info.java in my Spring Boot application, spring-orm throws an exception during start up time. This is the exception: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/UserTransaction at spring.beans@5.0.8.RELEASE/org.springframework.beans.factory.support

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

懵懂的女人 提交于 2019-11-29 23:40:34
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> <artifactId>jaxb-core</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>com.sun.xml

Difference in behaviour of the ternary operator on JDK8 and JDK10

僤鯓⒐⒋嵵緔 提交于 2019-11-29 20:33:39
Consider the following code public class JDK10Test { public static void main(String[] args) { Double d = false ? 1.0 : new HashMap<String, Double>().get("1"); System.out.println(d); } } When running on JDK8, this code prints null whereas on JDK10 this code results in NullPointerException Exception in thread "main" java.lang.NullPointerException at JDK10Test.main(JDK10Test.java:5) The bytecode produced by the compilers is almost identical apart from two additional instructions produced by the JDK10 compiler which are related to autoboxing and seem to be responsible for the NPE. 15:

How to use Java11 (Java10) with Eclipse Plugin?

谁说胖子不能爱 提交于 2019-11-29 19:54:13
问题 If I specify JavaSE-10 as minimum execution environment in my Eclipse plugin: I get following errors when starting my plugin as Eclipse Application: org.osgi.framework.BundleException: Could not resolve module: org.treez.core [597] Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=10))" Unresolved requirement: Require-Bundle: org.treez.javafxd3; visibility:="reexport" -> Bundle-SymbolicName: org.treez.javafxd3; bundle-version="1.0.0.qualifier"; singleton

findResource(“”) returning null when module-info.java is present, why is that?

廉价感情. 提交于 2019-11-29 16:35:11
问题 I'm debugging why in the presence of module-info.java in my Spring Boot application, spring-orm throws an exception during start up time. This is the exception: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction

Eclipse Oxygen Window Builder Error with Java SE 10.0.1

我只是一个虾纸丫 提交于 2019-11-29 12:58:06
I am using Eclipse Oxygen .3a and using compliance with JDK Java SE-10.0.1 I am trying to use windows builder which worked with Oxygen and Java SE-9 on another computer, however, I can not get the IDE to open the "Design" tab. with this setup... I am also running JDK SE10 When I click on the design tab I get the following error: Eclipse is running under 0, but this Java project has a 9 Java compliance level, so WindowBuilder will not be able to load classes from this project. Use a lower level of Java for the project, or run Eclipse using a newer Java version. I cant use a newer version of

Can't create project on Netbeans 8.2 with JDK 10

与世无争的帅哥 提交于 2019-11-29 11:29:25
I am trying to create project on Ubuntu.It just can't do it. Doesn't give me an error or something, just this blank screen. Help/About: Product Version: NetBeans IDE 8.2 (Build 201609300101) Updates: NetBeans IDE is updated to version NetBeans 8.2 Patch 2 Java: 10.0.2; OpenJDK 64-Bit Server VM 10.0.2+13-Ubuntu-1ubuntu0.18.04.1 Runtime: OpenJDK Runtime Environment 10.0.2+13-Ubuntu-1ubuntu0.18.04.1 System: Linux version 4.15.0-33-generic running on amd64; UTF-8; en_US (nb) User directory: /home/q/.netbeans/8.2 Cache directory: /home/q/.cache/netbeans/8.2 My Installation Steps: Step 1- I have