gpt4 book ai didi

java - install4J 7.0.6 找不到我的 BeanInfo

转载 作者:行者123 更新时间:2023-11-30 06:01:57 24 4
gpt4 key购买 nike

我想为我们的自定义操作添加描述,但 install4J 似乎找不到我的 BeanInfo。我尝试了 install4J 提供的 customCode-sample,但它也不起作用。我的代码分布在一个 jar 中。我尝试将其添加到扩展文件夹并在自定义代码中引用它。 bean :

package example;

import com.install4j.api.actions.AbstractInstallAction;
import com.install4j.api.context.InstallerContext;
import com.install4j.api.context.UserCanceledException;

public class MyAction extends AbstractInstallAction{

private static final long serialVersionUID = 2655170043113696434L;

@Override
public boolean install(InstallerContext context) throws UserCanceledException {
return false;
}

}

Bean信息:

package example;

import com.install4j.api.beaninfo.ActionBeanInfo;

public class MyActionBeanInfo extends ActionBeanInfo {

protected MyActionBeanInfo() {
super("My Action", "Execute my Code", "Other", false, true, 0, MyAction.class);
}

}

Manifest:
Name: example/MyAction.class
Install-Action: true

我想念什么?

最佳答案

您的MyActionBeanInfo类的构造函数受到保护,内省(introspection)器将无法实例化它。如果你公开它,它应该会起作用。

I tried to add it to the extensions folder and reference it at the Custom Code

如果自定义代码是项目的一部分,您应该在“安装程序 -> 自定义代码和资源”步骤中添加包含已编译类的 JAR 文件。

添加操作时,选择“自定义代码->在自定义代码中搜索操作”,您的操作应该会以正确的名称显示。

enter image description here

关于java - install4J 7.0.6 找不到我的 BeanInfo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52072163/

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