调用java 类,从IzPack调用Java类

How do you invoke a method from a Java class from IzPack? Static methods are OK, and I need to be able to pass it parameters.

Thank you!

Background info:

I am trying to write an IzPack installer which is able to detect a previously installed versions of the application. After finding out that it doesn't really support this feature (except in Windows), I think the only way to do this is through writing a Java class and calling it from IzPack.

Tim Williscroft has previously suggested this method, that reads the value of a static field of a class:

au.com.codarra.ela.installer.JBossChecker

hasJBossEnv

true

However, is it possible to call from somewhere other than a tag? I want to be able to call it from a tag.

Also, is it possible to call a method from a Java class instead of reading a value of a field? I want to be able to pass parameters to my class.

解决方案

You can call static methods, but I don't think you can pass in parameters.

You could create a new 'Condition type', but I have no experience with this so I can't confirm the flexibility it provides...

So, I don't have a direct response, but another suggestion which might help:

I tend to pass any complex post-processing on to separate processes.

Have you investigated the Processing panel? You can start any process, and pass in variables ..

e.g.

doit$variable

doit$variable

I've used it to set up services and start up immediately. That kind of thing. Just make sure your script exits cleanly, otherwise IzPack will hang.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值