Article View: be.comp.programming
Article #314Re: Exception in thread "main"
From: Philip Paeps
Date: Thu, 30 Oct 2008 19:54
Date: Thu, 30 Oct 2008 19:54
51 lines
2722 bytes
2722 bytes
Gaston Verhulst <gaston.verhulst@pandora.be> wrote:
> Hallo,
> Heb een en ander als inleiding over java gelezen en wil dit ook graag
> proberen in Linux.
>
> 1ste eenvoudige test lukte:
> [gastonv@telenetPC Java-beginners]$ cat jhello.java
> class hello {
> public static void main(String args[]){
> System.out.println("Hello World!");
> }
> }
> [gastonv@telenetPC Java-beginners]$ javac jhello.java
> [gastonv@telenetPC Java-beginners]$ java hello
> Hello World!
>
> 2de test, uit een cursus, lukt niet:
> [gastonv@telenetPC Java-beginners]$ cat Hallo.java
> /*
> * Een eenvoudig programma in Java,
> * dat "Hallo Wereld" schrijft
> * */
> import java.applet.*;
> import java.awt.*;
> public class Hallo extends Applet {
> public void paint (Graphics g) {
> g.drawString ("Hallo Wereld",60,30);
> }
> }
> [gastonv@telenetPC Java-beginners]$ javac Hallo.java
> [gastonv@telenetPC Java-beginners]$ java Hallo
> Exception in thread "main" java.lang.NoSuchMethodError: main
> Error: A JNI error has occurred, please check your installation and try
> again
>
> Wat zou hier fout zijn?
> Dank bij voorbaat voor een helpende tip.
> Gaston Verhulst.
Iets dat Applet extend draai je niet onder een shell. Iets moet Applet
providen. Meestal is dat een webbrowser.
- Philip
--
Philip Paeps Please don't email any replies
philip@paeps.cx I follow the newsgroup.
The hand that rocks the craddle usually is attached
to someone who isn't getting enough sleep.
Technical Details
Message-ID:
<slrnggk475.1ejl.philip+usenet@detritus.paeps.cx>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mailReferences:
<MCmOk.121651$xU3.77898@newsfe19.ams2>Show Full Headers
Complete Article Headers
X-Google-Thread: fcea4,c4c67c7dfa7987f2 X-Google-Attributes: gidfcea4,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Philip Paeps <philip+usenet@paeps.cx> Newsgroups: be.comp.programming Subject: Re: Exception in thread "main" Date: 30 Oct 2008 19:54:13 GMT Organization: Happily Disorganized Lines: 51 Message-ID: <slrnggk475.1ejl.philip+usenet@detritus.paeps.cx> References: <MCmOk.121651$xU3.77898@newsfe19.ams2> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: individual.net j3pGHFLhh27uxPpTaV7tvgU0RcIHG6Fbd1ab40QDWQmvE9DHhN Cancel-Lock: sha1:kBlt6hm1hohZMuOL+SWeRm49zqU= X-PGP-Fingerprint: 356B AE02 4763 F739 2FA2 E438 2649 E628 C5D3 4D05 X-Date: Today is Pungenday, the 11st day of The Aftermath in the YOLD 3174 X-Phase-of-Moon: The Moon is Waxing Crescent (4% of Full) User-Agent: slrn/0.9.9p1 (FreeBSD)