Article View: be.comp.programming
Article #313Exception in thread "main"
From: Gaston Verhulst
Date: Thu, 30 Oct 2008 18:00
Date: Thu, 30 Oct 2008 18:00
37 lines
2124 bytes
2124 bytes
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.
Technical Details
Message-ID:
<MCmOk.121651$xU3.77898@newsfe19.ams2>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2!eweka.nl!hq-usenetpeers.eweka.nl!cyclone03.ams.highwinds-media.com!news.highwinds-media.com!npeersf01.ams.highwinds-media.com!newsfe19.ams2.POSTED!7564ea0f!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: fcea4,c4c67c7dfa7987f2,start X-Google-Attributes: gidfcea4,domainid0,public,usenet X-Google-Language: DUTCH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2!eweka.nl!hq-usenetpeers.eweka.nl!cyclone03.ams.highwinds-media.com!news.highwinds-media.com!npeersf01.ams.highwinds-media.com!newsfe19.ams2.POSTED!7564ea0f!not-for-mail From: Gaston Verhulst <gaston.verhulst@pandora.be> User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 Newsgroups: be.comp.programming Subject: Exception in thread "main" Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lines: 38 Message-ID: <MCmOk.121651$xU3.77898@newsfe19.ams2> NNTP-Posting-Host: 81.82.11.56 X-Complaints-To: http://telenet.be/ X-Trace: newsfe19.ams2 1225389612 81.82.11.56 (Thu, 30 Oct 2008 18:00:12 UTC) NNTP-Posting-Date: Thu, 30 Oct 2008 18:00:12 UTC Organization: telenet.be Date: Thu, 30 Oct 2008 19:00:11 +0100