java-10

Migrating a GWT 2.5 web app to Java 10

∥☆過路亽.° 提交于 2019-12-12 09:39:26
问题 I have a substantial web-app that is built using GWT-2.5.1 and Java 8. With the deprecation of Java 8, I need to migrate this to Java 10 / 11. I've managed to get past a few issues, but I've hit one I cannot get past. When building the app, I get the following error: [INFO] Compiling module com.<xxx> [INFO] [ERROR] Unable to find type 'java.lang.Object' [INFO] [ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core' either directly or indirectly (most often by inheriting

Does Java 10 provide a val keyword? If not, why not?

二次信任 提交于 2019-12-12 07:39:16
问题 Java 10 brings a C#-like var keyword for local type-inference. But does Java 10 also provide a val keyword, as is found in Scala? val would work like var but the binding would be final . var x = "Hello, world. "; x = "abc"; // allowed val y = "Hello, world. "; y = "abc"; // forbidden If it does not, is there a reason that this is the case? 回答1: There is no val in Java 10, as stated in JEP 286: Local-Variable Type Inference: Syntax Choices There was a diversity of opinions on syntax. The two

How can I view Java 10 Javadocs (in Eclipse)

做~自己de王妃 提交于 2019-12-11 13:06:58
问题 Firstly, I do realize this question has been asked in many permutations all over stackoverflow. I searched quite a bit before posting, so please don't link to another SO question unless it answers my specific question and scenario. I recently upgraded from Java 8 to 10. Now, however, I cannot view source or javadocs for any Java class or library. Makes coding a lot more cumbersome. How can I attach the source and/or javadocs for Java 10, either OpenJDK's version of it and/or Oracle's? I've

Module not found: How to compile JDK 10 Eclipse Maven Project with Module?

江枫思渺然 提交于 2019-12-10 23:45:54
问题 Followings are the main sections of my pom.xml: properties: <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.targetEncoding>UTF-8</project.build.targetEncoding> <jdk.release>10</jdk.release> <jdk.vendor>oracle</jdk.vendor> <maven.compiler.source>1.10</maven.compiler.source> <maven.compiler.target>1.10</maven.compiler.target> <dependency.asm.version>6.2</dependency.asm.version> <dependency.log4j2.version>2.11.0</dependency.log4j2.version> <plugin

How do I change Swing Timer Delay inside actionPerformed()

北城余情 提交于 2019-12-10 11:30:44
问题 So I'm building this music player app which plays notes which are dragged and dropped onto a JLabel. When I hit the play button, I want each note to be highlighted with a delay value corresponding to that note. I used a Swing Timer for this but the problem is, it just loops with a constant delay which is specified in the constructor. playButton.addActionListener(e -> { timerI = 0; System.out.println("Entered onAction"); Timer t = new Timer(1000, e1 -> { if (timerI < 24) { NoteLabel thisNote =

Host plug-in JavaSE has not been found in RCP application with Java 10

独自空忆成欢 提交于 2019-12-10 11:07:57
问题 I moved my RCP application from Eclipse Oxygen to Photon, and also from Java 8 to Java 10. The code compiles and the application works fine if I start it from Eclipse. However, when I try to build my application, I get an error: plug-in JavaSE_0.0.0 has not been found Missing Constraint: Bundle-RequiredExecutionEnvironment: JavaSE-10 Host plug-in JavaSE_0.0.0 has not been found. I can't find any useful solution on Google. Maybe some of you can help me. My manifest file contains this header:

Local Variable Type Inference not being recognized

好久不见. 提交于 2019-12-10 11:06:34
问题 I installed JDK 10 to try out the new features, and I got a big hung up on var - for some reason, even though the JDK was added to IntelliJ (version 2018.1), the following code still won't compile, saying Java cannot find the symbol var : public class Variations { public static void main(String[] args) { var local = "foo"; System.out.println(local); } } Am I missing something obvious here, or is there an option in IntelliJ I should enable? EDIT: Both project and module SDK and Language Level

Execution attach-javadocs of goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.0:jar failed with Java10

被刻印的时光 ゝ 提交于 2019-12-09 13:15:50
问题 Following the link Upgrade to Java 10 breaks links in Javadoc comments to JDK packages and trying to reproduce the same while I could set the build configuration to : <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.7.0</version> <configuration> <source>9</source> <target>9</target> </configuration> <dependencies> <dependency> <groupId>org.ow2.asm</groupId> <artifactId>asm</artifactId> <version>6.1</version> <

IntelliJ IDE (Community Version) doesn't support var declaration Java 10

Deadly 提交于 2019-12-09 12:41:36
问题 I've installed the version 2018.1 of IntelliJ IDEA (COMMUNITY EDITION) , which added support for Java 10 . When I tried to use new "var" to type local variable, the IDE highlights it with red colour and the lovely phrase: "Cannot resolve the type "var". Please see attachment varRed I've read another post that happens exactly the same issue in which a member gave a possible solution https://stackoverflow.com/a/49719734/9478809 I've done that as well, I've created a live template for that type

NoSuchMethodError: <init> in com.sun.glass.ui.win.WinApplication.staticScreen_getScreens

本小妞迷上赌 提交于 2019-12-09 09:53:59
问题 Since upgrading to install4j 7.0.5 and Java 10, users that run our application on Windows more and more often report that the application throws java.lang.NoSuchMethodError: <init> at javafx.graphics/com.sun.glass.ui.win.WinApplication.staticScreen_getScreens(Native Method) at javafx.graphics/com.sun.glass.ui.Screen.initScreens(Unknown Source) at javafx.graphics/com.sun.glass.ui.Application.lambda$run$1(Unknown Source) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native