如何在命令提示符下使用java -D将内容传递给我的JVM中的所有应用程序? [英] How to use java -D in command prompt to pass something to all applications in my JVM?

查看:68
本文介绍了如何在命令提示符下使用java -D将内容传递给我的JVM中的所有应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  class  ExtensionClassLoader 
{
public static void main( String [] args)
{
String i = null;
System.out.println( hello);
i = System.getProperty(i);
}
}





我的尝试:



实际上,我试图了解扩展类加载器。当我在命令提示符下键入(java -Di = 10 ExtensionClassLoader)时,我得到Nullpointer异常。

有关此类加载器的任何信息或我可以在哪里找到信息的链接都将受到高度赞赏。

解决方案

  String  i = null; 
System.out.println( hello);
i = System.getProperty(i);



您认为哪些信息 getProperty 将在您返回时返回发送值为 null

您需要传递要检索的属性的实际名称


class ExtensionClassLoader
{
	public static void main(String[] args)
	{
		String i=null;
		System.out.println("hello");
		i=System.getProperty(i);
	}
}



What I have tried:

Actually, I am trying to know about extension classloader. I am getting Nullpointer exception when i type (java -Di=10 ExtensionClassLoader) in command prompt.
Any information about this classloader or link to where can I find information will be highly appreciated.

解决方案

String i=null;
System.out.println("hello");
i=System.getProperty(i);


What information do you think getProperty will return when you send it a value of null?
You need to pass the actual name of the property you wish to retrieve.


这篇关于如何在命令提示符下使用java -D将内容传递给我的JVM中的所有应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆