Exception in thread "main" java.lang.NoClassDefFoundError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at java.awt.Toolkit$2.run(Toolkit.java:498)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:489)
at javax.swing.text.html.CSS.getValidFontNameMapping(CSS.java:932)
at javax.swing.text.html.CSS$FontFamily.parseCssValue(CSS.java:1789)
at javax.swing.text.html.CSS.getInternalCSSValue(CSS.java:531)
at javax.swing.text.html.CSS.addInternalCSSValue(CSS.java:516)
at javax.swing.text.html.StyleSheet.addCSSAttribute(StyleSheet.java:436)
at javax.swing.text.html.HTMLDocument$HTMLReader$ConvertAction.start(HTMLDocument.java:2536)
at javax.swing.text.html.HTMLDocument$HTMLReader.handleStartTag(HTMLDocument.java:1992)
at javax.swing.text.html.parser.DocumentParser.handleStartTag(DocumentParser.java:145)
at javax.swing.text.html.parser.Parser.startTag(Parser.java:333)
at javax.swing.text.html.parser.Parser.parseTag(Parser.java:1786)
at javax.swing.text.html.parser.Parser.parseContent(Parser.java:1821)
at javax.swing.text.html.parser.Parser.parse(Parser.java:1980)
at javax.swing.text.html.parser.DocumentParser.parse(DocumentParser.java:109)
at javax.swing.text.html.parser.ParserDelegator.parse(ParserDelegator.java:74)
at javax.swing.text.html.HTMLEditorKit.read(HTMLEditorKit.java:239)
at Search.ParseForUrl(Search.java:64)
at Search.StartSearch(Search.java:45)
at Robot.main(Robot.java:18)
You haven't posted your code, you haven't said what Java or Linux version
you are using, the error message says it cannot find a class for
classForName().
Without seeing the code, and reading through the stack trace, I can only
guess -- it appears that you are specifying a font that is not available on
the machine. Remedy: avoid specifying fonts in your HTML file. This is good
general advice about HTML design in any case.
Parenthetically, recent Red Hat Linux versions have been broken WRT fonts.
--
Paul Lutus
www.arachnoid.com
"emin" <euyu...@yahoo.com> wrote in message
news:44b64eae.01120...@posting.google.com...
> I have a problem about the platforms. I wrote an aplication with
> java. I can run it on Windows but when I try to run it on linux, it
> throws at any time and gives the error seen below. (My program is
> about the parsing of an html file, and I use java's present
> libraries for it.) What can i do?
>
> Exception in thread "main" java.lang.NoClassDefFoundError
> at java.lang.Class.forName0(Native Method) at
> java.lang.Class.forName(Class.java:120) at
> java.awt.Toolkit$2.run(Toolkit.java:498) at
Most likely you get this error because you don't have a connection to
an Xserver (yeah, I know the error message could be more descriptive).
If you don't want to run a real Xserver use Xvfb or a AWT
implementation that doesn't need X (e.g. http://www.eteks.com/pja/en/).
Juergen
--
Juergen Kreileder, Blackdown Java-Linux Team
http://www.blackdown.org/java-linux.html
Run Java 2 SE v1.3.1 on your iPAQ:
http://www.handhelds.org/pipermail/ipaq/2001-June/007221.html
euyu...@yahoo.com (emin) wrote in message news:<44b64eae.01120...@posting.google.com>...