我正在尝试定义Java 9模块.我已经定义了类似的东西:
module my.module.name {
}
Run Code Online (Sandbox Code Playgroud)
然后我的许多文件开始给我错误,他们找不到一些包.然后我使用了IntelliJ的自动帮助功能,它在我的module-info.java中添加了几个"require"语句.所以它变得像:
module my.module.name {
requires spring.web;
requires sshd.core;
requires com.fasterxml.jackson.core;
....
}
Run Code Online (Sandbox Code Playgroud)
现在IntelliJ显示我的所有代码没有错误.但是当我在"Maven Projects"窗口中单击"compile"时(我正在使用Maven 3.5.3和Oracle JDK 10进行编译),它告诉我以下内容:
src/main/java/module-info.java:[2,20] module not found: spring.web
src/main/java/module-info.java:[11,18] module not found: sshd.core
src/main/java/module-info.java:[13,35] module not found: com.fasterxml.jackson.core
...
same for the other modules I "require".
Run Code Online (Sandbox Code Playgroud)
据我所知,未定义为模块的第三方库会生成"自动"模块.所以我发现了我需要的其中一个罐子:
C:\Users\<my username>\.m2\repository\org\springframework\spring-web\5.0.5.RELEASE\spring-web-5.0.5.RELEASE.jar
Run Code Online (Sandbox Code Playgroud)
并希望使用以下命令查看"自动"模块的名称:
jar.exe" --file=spring-web-5.0.5.RELEASE.jar --describe-module
No module descriptor found. Derived automatic module.
spring.web@5.0.5.RELEASE automatic
...
Run Code Online (Sandbox Code Playgroud)
所以根据我的调查,我"需要"的模块的名称是正确的!我错过了什么?我为什么得到
module not found: spring.web
Run Code Online (Sandbox Code Playgroud)
和其他模块一样吗?我错过了一些路径或什么?
编辑:根据要求,这是我的pom.xml:
<?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> …
Run Code Online (Sandbox Code Playgroud) 我正在考虑为大约20MHz的设备进行嵌入式编码,具有6mb ram,带有ARM32处理器.任何人都可以建议最好/最合适的语言来编程嵌入式系统吗?我在考虑:
有什么建议?谢谢
编辑 - 看起来像C和Lua是赢家.干得好!
编辑 - 实时不是问题,更多的是有限的ram/cpu指令事物.
我正在尝试使用 jlink 工具来构建一个 java 可执行文件。我按以下方式使用它:
jlink.exe --module-path <path-to-modules> --add-modules <my-module-name> --output dist --launcher launch=org.demo/org.demo.Main --strip-debug --compress 2 --no-header-files --no-man-pages
Run Code Online (Sandbox Code Playgroud)
但它给了我以下错误:
Error: signed modular JAR <path-to-modules>\bcprov.jdk15on.jar is currently not supported, use --ignore-signing-information to suppress error
Run Code Online (Sandbox Code Playgroud)
当我添加“--ignore-signing-information”选项时,它可以很好地构建我的可执行文件,但它给了我以下警告:
WARNING: signed modular JAR <path-to-modules>\bcprov.jdk15on.jar is currently not supported
Run Code Online (Sandbox Code Playgroud)
然后,当我执行已经构建的可执行文件时,我收到以下异常:
org.apache.sshd.common.SshException: Failed (NoSuchProviderException) to execute: JCE cannot authenticate the provider BC
at sshd.core/org.apache.sshd.common.future.AbstractSshFuture.verifyResult(Unknown Source)
at sshd.core/org.apache.sshd.client.future.DefaultAuthFuture.verify(Unknown Source)
at sshd.core/org.apache.sshd.client.future.DefaultAuthFuture.verify(Unknown Source)
Caused by: java.util.jar.JarException: Non-Oracle JCE providers may not be linked into the image,they must be …
Run Code Online (Sandbox Code Playgroud) jar-signing jlink java-platform-module-system java-9 java-module
我正在考虑使用“WireMock”实用程序,以便为我的自动测试创建基于 HTTP 的 API 的简单模拟器。我的问题是一些测试需要服务器发送事件 (SSE),目前不支持(据我在他们的 github 评论中读到),至少不是开箱即用的。有谁知道我是否可以使用 WireMock 库的现有功能实现简单的 SSE 模拟器,或者可能知道一些支持 SSE 的相同类型的替代库?
java ×2
java-9 ×2
arm ×1
embedded ×1
jar-signing ×1
java-module ×1
java-platform-module-system ×1
jlink ×1
maven ×1
module-path ×1
simulator ×1
testing ×1
wiremock ×1