简体   繁体   English

将Java命令行参数传递给插件

[英]Passing java command line arguments to a plugin

The Setup: 设置:

I am writing a plugin. 我在写一个插件。 The plugin runs under a program that was built upon the NetBeans Module platform. 该插件在基于NetBeans Module平台构建的程序下运行。 So in order to run my code, first you launch the main program, then activate the plugin. 因此,为了运行我的代码,首先启动主程序,然后激活插件。

The Problem: 问题:

I am working on internationalization, and the first language is Japanese. 我正在致力于国际化,第一语言是日语。 I have it working for the most part, but there are a handful of bugs our Japan office has identified that I need to deal with. 我大部分时间都在使用它,但是日本办事处发现了一些我需要解决的错误。 In order to avoid having to do an extended back & forth effort with the Japanese office, I'm trying to get my plugin to work in Japanese on my workstation by changing the locale, either through a setenv command for the session, or using the "-locale ja" command line argument. 为了避免与日文办公室进行更多的来回工作,我试图通过更改区域设置来使我的插件在工作站上以日文工作,方法是通过会话的setenv命令或使用“ -locale ja”命令行参数。

Both will get the main program to switch over to Japanese, but the plugin refuses to run in anything but English. 两者都将获得切换到日语的主程序,但是该插件拒绝以英语以外的任何语言运行。 The guys in the Japan office (whose machines are permanently set to JP_ja) have no trouble getting the plugin to use Kanji without any command line arguments. 日本办公室的人员(其计算机永久设置为JP_ja)没有任何命令行参数就可以让插件使用汉字。

The Question: 问题:

How do I get my plugin to use the correct locale setting? 如何使我的插件使用正确的语言环境设置?

Thanks 谢谢

For anyone who is curious, I found the answer. 对于任何好奇的人,我都找到了答案。

Launch the main program with jvmargs, like this: 使用jvmargs启动主程序,如下所示:

/mainProg -jvmargs "-Duser.country=JP -Duser.language=ja" / mainProg -jvmargs“ -Duser.country = JP -Duser.language = ja”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM