Posted by:sunjavaduke
Posted on:2006-05-03 02:14
如何使用命令行命令java执行包内的文件
如:
helloworld.HelloWorld
假如编译后,生成了helloworld文件夹,里面是HelloWorld.class
如果当前目录是和helloworld同一级别目录
如何使用java命令在包外边执行里面的文件呢?
这是我查的文档,但是还是执行不了
-ea[:"..." | : ]
Enable assertions. Assertions are disabled by default.
With no arguments, enableassertions or -ea enables assertions. With one argument ending in "...", the switch enables assertions in the specified package and any subpackages. If the argument is simply "...", the switch enables assertions in the unnamed package in the current working directory. With one argument not ending in "...", the switch enables assertions in the specified class.
If a single command line contains multiple instances of these switches, they are processed in order before loading any classes. So, for example, to run a program with assertions enabled only in package com.wombat.fruitbat (and any subpackages), the following command could be used:
java -ea:com.wombat.fruitbat...
The -enableassertions and -ea switches apply to all s loaders and to system classes (which do not have a class loader). There is one exception to this rule: in their no-argument form, the switches do not apply to system. This makes it easy to turn on asserts in all classes except for system classes. A separate switch is provided to enable asserts in all system classes; see -enablesystemassertions below.