posted 13 years ago
You can either use the switch with or without arguments. If you use arguments, you always need to use a colon.
Using the switch without arguments means that you enable assertions for all classes, except for system classes. If you arguments, there are two forms:
-ea:com.example...
-ea:com.example.Klass
The first one will enable assertions for class Klass.
The second one will enable assertions for all classes in com.example, and recursively enable assertions for all sub-packages.
"java -ea com.Bar" means run the class Bar with all assertions enabled (except system classes).
"java -ea:com.Bar" means nothing, because you didn't supply a class to run.