在 WebSphere Application Server 管理控制台中,下面有一个部分 应用程序服务器 > server1 > 进程定义 > 环境条目
我不明白什么是环境条目。它们不是系统属性,因为它们是在流程定义 > Java 虚拟机 > 自定义属性中定义的。
那是什么?如何从应用程序内访问它们。
最佳答案
引用http://www-01.ibm.com/support/docview.wss?uid=swg21254153 ,官方描述是;
Environment entries can be used to specify variables not specific to WebSphere Application Server, but are defined by other elements, such as UNIX®, Language Environment® (LE), or third-party vendors, among others. These variables tend to be operating system-specific.
因此它们是特定于操作系统的(即 Windows 的 PATH、AIX 的 LIBPATH、Solaris 的 LD_LIBRARY_PATH)。
If a native library is dependent on other native libraries, the dependent libraries must be configured on the LIBPATH of the JVM hosting the application server (rather than on the native path shown in the above figure) in order for that library to load successfully. You should configure an environment entry by selecting Servers > Application Servers > server_name > Java and Process Management > Process Definition > Environment Entries (where server_name is the name of the server; for example, server1). On the Environment Entries page, create a new environment entry to specify the LIBPATH of the JVM.
您可以使用 System.getenv()(而不是 System.getProperties(),它返回自定义属性和通用 JVM 参数)来访问这些变量。
关于configuration - IBM WebSphere 应用服务器 : What are "environment entries" for?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10508527/