gpt4 book ai didi

JavaFX 独立应用程序缺少 Cipher 加密服务?

转载 作者:行者123 更新时间:2023-11-29 09:00:10 30 4
gpt4 key购买 nike

由于某些原因,当应用程序在自包含之后执行时,JavaFX目前似乎不支持Cipher加密服务的任何算法strong> 部署,如所述here .

给定这段代码:

import java.security.Security;
import java.util.Iterator;
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.stage.Stage;



public final class Main extends Application
{
@Override
public void start(final Stage stage)
{
final ObservableList<String> ol = FXCollections.observableArrayList();
final ListView<String> lv = new ListView(ol);

for (final Iterator<String> iter = Security.getAlgorithms("Cipher").iterator(); iter.hasNext();)
ol.add(iter.next());

final Scene s = new Scene(lv, 500, 400);

stage.setScene(s);
stage.sizeToScene();
stage.show();
}
}

如果此代码通过 java 启动器 在本地运行,则使用各种算法填充输出没有问题,但如果应用程序已打包为 列表独立

但是,我也偶然发现了这个:

Only a subset of Java Runtime is included by default. Some optional and rarely used files are excluded to reduce the package size, such as all executables. If you need something that is not included by default, then you need to copy it in as a post-processing step. For installable packages, you can do this from the config script that is executed after populating the self-contained application folder. See Section 6.3.3, "Customization Using Drop-In Resources."

引用的段落可能是可能的原因吗?需要什么样的解决方法才能将此功能包含到独立运行时中?

谢谢。

最佳答案

查看this link默认情况下不打包捆绑的 JCE。

关于JavaFX 独立应用程序缺少 Cipher 加密服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17950881/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com