JavaPackager
JavaPackager copied to clipboard
How to specify parameters to application, not vm args.
I'm submitting a feature request.
I used runnableJar and mainClass parameter of plugin, and I want to specify some parameters to the mainClass, how to ?
- JavaPackager version: 1.7.5
- OS version: Windows
- JDK version: 1.8
- Build tool: Maven
Hi @Ryanznoco! Do you want to specify some fixed params? I mean, when you run your app, internaly it uses those fixed params? Or do you want your app to read those params specified when starting your app?
@Ryanznoco ,main函数的参数,建议你在代码里面自行实现
public static void main(String[] args){
if (args.length == 0){
args = new String[]{"arg1","arg2"};
}
System.out.println(Arrays.toString(args));
}
@Ryanznoco ,main函数的参数,建议你在代码里面自行实现
public static void main(String[] args){ if (args.length == 0){ args = new String[]{"arg1","arg2"}; } System.out.println(Arrays.toString(args)); }
I think this is the easiest way 👏 👏
@Ryanznoco, if you need help again about this issue, feel free to reopen it