java-9

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

clientBuilder.sslSocketFactory not supported on JDK 9+

て烟熏妆下的殇ゞ 提交于 2019-12-12 12:16:54
问题 I get following error on my project in Eclipse 4.7.0. I have jdk-9_windows-x64_bin.exe Resource: pom.xml Mavan dependency Problem (1 item) clientBuilder.sslSocketFactory not supported on JDK 9+ on mvn clean install in http://repo.maven.apache.org/maven2 was cached in the local repository , resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 5, column 10 -> [Help 2] [ERROR] [ERROR]

Java 9 takeWhile and dropWhile to read and skip certain lines

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 10:43:38
问题 I have a text file that contains multiple reports in it. Each report starts with a literal "REPORT ID" and have a specific value i.e ABCD. For simple case, I want to extract data of only those reports which have their value ABCD for example. And for complexity, I want to extract data of only those reports which have TAG1 value (2nd line)as 1000375351 and report value is same as ABCD. I have done it using traditional way. My decideAndExtract(String line) function have the required logic. But

How to use log4j with maven and java9 in Eclipse Oxygen?

∥☆過路亽.° 提交于 2019-12-12 08:16:07
问题 I try to migrate a Java8 project to Java9. The auto generated module-info.java contains an entry requires log4j; and an error is shown: log4j cannot be resolved to a module => How do I correctly include log4j as a module dependency with Java9? (I have the same issue for following dependencies: requires hibernate.core; requires hibernate.jpa.2.1.api; requires jcommander; requires junit; requires reflections; ) What I did so far: Installed Java 9.0.1 Upgraded Eclipse to Oxygen.1a Release (4.7

How to list syntax and available tags for -Xlog

笑着哭i 提交于 2019-12-12 07:26:33
问题 OpenJDK 9's new Unified JVM Logging can filter logs by tags, but the JEP does not provide a list of all available tags. How can I list all available arguments? 回答1: java -Xlog:help prints the argument syntax, including the list of tags available in that particular version, which may change over time. Note that logging with -Xlog:<tag> may not print everything related to that tag since it requires the log message to only have that tag. Use -Xlog:<tag>* instead to include messages containing

Error running App: No JDK specified

前提是你 提交于 2019-12-11 17:35:18
问题 I have installed Android studio 3.0.1 and when i run the app he gives me an error Error running App: No JDK specified Note that i have installed JDK 9 and I made two environment variable JAVA_HOME and JDK_HOME and edit path variable and in project structure I choose JDK 9 but I am also failed to run!! 回答1: Try following, it did work for me: Go to File -> Project Structure -> SDK Location and check if the path for SDK and JDK location specified by you is correct. If its not then set the

Find log file name at run time with Java 9 JDK Logging

て烟熏妆下的殇ゞ 提交于 2019-12-11 16:58:22
问题 I have the same question as Find actual opened logfile with JDK Logging, except that I want to use an API that's supported by Java 9. In Java 8, I currently use nearly the same reflection hack as described in the answer to that question except that I look at the actual log file name instead of parsing the lockFileName. Here's my code: private static String logFileName = null; public static String getLogFileName() { // determined on demand and cached so we only need to do all of this the first

Spring Boot module not found error

流过昼夜 提交于 2019-12-11 15:06:30
问题 I am creating a Spring Boot application on Java 9. If I keep parent as below in pom.xml: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.1.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> and module-info.java as: module com.journaldev.spring.SpringWebflux { requires reactor.core; requires spring.web; requires spring.context; requires spring.webflux; requires spring.boot; requires spring

Module-info.java won't compile in maven project (Syntax error on token “module”, interface expected)

瘦欲@ 提交于 2019-12-11 11:25:33
问题 I am starting a new maven project that should run with Spring Boot (in case that's relevant), and it compiled fine. But then, I decided to start using Java9-modules. So, I had eclipse generate the module-info.java file that looks like this: module BirdTreeModel { exports mjl.familytree.birdtree; requires junit; requires spring.boot; requires spring.boot.autoconfigure; requires spring.boot.test; requires spring.test; } This causes a compile error, however. Eclipse says: "Syntax error on token

What are the algorithms behind the Level 1 and Level 2 compression using Jlink (Java 9)?

筅森魡賤 提交于 2019-12-11 04:07:31
问题 The documentation (https://docs.oracle.com/javase/9/tools/jlink.htm#JSWOR-GUID-CECAC52B-CFEE-46CB-8166-F17A8E9280E9) says: Level 1 -> Constant String sharing Level 2 -> zip My questions are: 1). Which strings get shared ? 2). Who share these strings ? 3). Compression in Level 2 does not create a zip file. Then how it is a zip compression ? 来源: https://stackoverflow.com/questions/48180953/what-are-the-algorithms-behind-the-level-1-and-level-2-compression-using-jlink