Not all Java classes can be run as an application

jabber (jabber)
If we issue a command like

java Hello

it implies we take it as an Java Application. It should have a main(String args[]) method as
an entry point. The code you mentioned, I guess because I don't have a copy of Thinking in Java, has No main() methods.
So this you cannot run it by issuing a command like

java AllOps

If you do that, JVM will examine the byte-code. Once it goes throught the byte-code and does not foind main() method, it throws the error you cited here.

Jabber bets!

godd luck.
2000-11-3 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: Jabber, when I read ThinkingInjava, I run a programme named AllOps.java. First, I compiled it successfully, afterwards, I run it, but error "Exception in thread 'main'...". Why?

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论