refactor: #I7VAM0 解决icu4j link失败的问题
This commit is contained in:
parent
2410f6e213
commit
849161d237
43
libs/README.md
Normal file
43
libs/README.md
Normal file
@ -0,0 +1,43 @@
|
||||
# 解决jlink error指南
|
||||
|
||||
## 现象
|
||||
|
||||
jlink时,如果出现如下错误,参考本文档
|
||||
|
||||
```
|
||||
"automatic module cannot be used with jlink"
|
||||
```
|
||||
|
||||
## 解决方法:
|
||||
|
||||
1. 为jar生成module-info.class
|
||||
|
||||
```shell
|
||||
jdeps --ignore-missing-deps --module-path <jar_dir_path> --add-modules <module_name --generate-module-info <out_dir_path> <jar_path>
|
||||
javac --patch-module <module_name>=<jar_path> <module-info.java>
|
||||
jar uf <jar_path> -C <module_name> <module-info.class>
|
||||
```
|
||||
|
||||
以本次icu4j为例,先将依赖的jar包copy到libs目录,然后执行:
|
||||
|
||||
```shell
|
||||
jdeps --ignore-missing-deps --module-path libs --add-modules com.ibm.icu --generate-module-info libs/tmpOut libs/icu4j-73.2.jar
|
||||
javac --patch-module com.ibm.icu=libs/icu4j-73.2.jar libs/tmpOut/com.ibm.icu/module-info.java
|
||||
jar uf libs/icu4j-73.2.jar -C libs/tmpOut/com.ibm.icu module-info.class
|
||||
```
|
||||
|
||||
2. pom中添加依赖
|
||||
|
||||
```xml
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ibm.icu</groupId>
|
||||
<artifactId>icu4j</artifactId>
|
||||
<version>73.2</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/icu4j-73.2.jar</systemPath>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
## Reference
|
||||
1. [java_jlink_automatic_module_cannot_be_used_with_jlink](https://tacosteemers.com/articles/java_jlink_automatic_module_cannot_be_used_with_jlink.html)
|
||||
BIN
libs/icu4j-73.2.jar
Normal file
BIN
libs/icu4j-73.2.jar
Normal file
Binary file not shown.
4
pom.xml
4
pom.xml
@ -58,7 +58,9 @@
|
||||
<dependency>
|
||||
<groupId>com.ibm.icu</groupId>
|
||||
<artifactId>icu4j</artifactId>
|
||||
<version>68.1</version>
|
||||
<version>73.2</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/icu4j-73.2.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
package org.jcnc.jnotepad.controller.event.handler;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import org.jcnc.jnotepad.app.config.GlobalConfig;
|
||||
|
||||
/**
|
||||
* 换行事件处理,针对当前选中tab进行格式化。<br/>
|
||||
* 配置变更时:<br/>
|
||||
* 1. 更新内存全局配置<br/>
|
||||
* 2. 对当前tab生效配置。每次tab切换,根据全局配置设置进行变更<br/>
|
||||
* <p>
|
||||
* 用于在文本区域中插入一个换行符。
|
||||
* @see GlobalConfig
|
||||
*
|
||||
* @deprecated 事件处理将使用item的listener实现
|
||||
*
|
||||
* @author 许轲
|
||||
*/
|
||||
@Deprecated
|
||||
public class LineFeed implements EventHandler<ActionEvent> {
|
||||
/**
|
||||
* 处理事件的方法,将一个换行符插入到文本区域的末尾。
|
||||
*
|
||||
* @param event 触发的事件对象
|
||||
*/
|
||||
@Override
|
||||
public void handle(ActionEvent event) {
|
||||
//
|
||||
|
||||
}
|
||||
}
|
||||
@ -148,7 +148,6 @@ public class JNotepadMenuBar extends MenuBar {
|
||||
openItem.setOnAction(new OpenFile());
|
||||
saveItem.setOnAction(new SaveFile());
|
||||
saveAsItem.setOnAction(new SaveAsFile());
|
||||
lineFeedItem.setOnAction(new LineFeed());
|
||||
lineFeedItem.selectedProperty().addListener((observableValue, before, after) -> {
|
||||
// 1. 更新全局配置
|
||||
GlobalConfig.getConfig().setAutoLineConfig(after);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user