Can anyone say if Apache NetBeans 9.0 support java 11 and if so what are the requirements to make that work?
Prensently I can compile and run java 11 code in NetBeans 9.9 but it is underlined with red and the error message is "cannot find symbol ...".
Below is the pom.xml file I use:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>IoTlite</groupId>
<artifactId>ioTlite</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>ioTlite</name>
<description>ioTlite backend project with Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.0.RC1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>10</source>
<target>10</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
How, for example pom-file should be changed?
答案 0 :(得分:3)
没有NetBeans 9不支持Java 11(仅支持9和10)[1]。
计划于11月[2]发行的NetBeans 10将支持Java 11 [3]。不幸的是,它尚不可用(至少是正式版本)。
最新候选版本可以在此处下载
https://dist.apache.org/repos/dist/dev/incubator/netbeans/incubating-netbeans/
由于NetBeans 10最新投票候选人5处于最终发行投票阶段[4],我们应该期望在未来几天内最终发行。
答案 1 :(得分:3)
具有JDK 11支持的NetBeans 10 has been released:
JDK 11支持
通过以下方式增强了对JDK 11的支持:
与nb-javac项目集成,添加了对JDK 11的支持。
删除了CORBA模块。
支持JEP 309,动态类文件常量。
支持JEP 323,Lambda参数的本地变量语法。
对LVTI的支持对Lamdba参数的支持
新提示可将lambda参数的变量类型转换为'var'(JDK 11及以上)
var lambda参数的代码完成
对var类型lambda参数的代码完成支持。(JDK 11和 以上)
有关更多详细功能,请参见JDK 11 Confluence Page。