linux - java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit -


i'm working on xubuntu 13.04 , developing swing applications. wanted try application ran java.lang.noclassdeffounderror: not initialize class java.awt.toolkit on startup.

i've found several questions server/client vms , noticed have server vm , linux 64 there no client vm anymore. nevertheless imho problem shouldn't depend on vm i'm running on.

has else noticed problem , has solved it? doing wrong? 64bit jdk works fine, when try use 32bit jdk startup fails.

thanks in advance!

p.s.: java version 1.7.0_25 , same 1.7.0_09

edit

when using headless mode, following exceptions occur:

java.lang.reflect.invocationtargetexception     @ java.awt.eventqueue.invokeandwait(eventqueue.java:1272)     @ java.awt.eventqueue.invokeandwait(eventqueue.java:1247)     @ javax.swing.swingutilities.invokeandwait(swingutilities.java:1349)     @ main.main(main.java:218) caused by: java.awt.headlessexception     @ java.awt.graphicsenvironment.checkheadless(graphicsenvironment.java:207)     @ java.awt.window.<init>(window.java:535)     @ java.awt.frame.<init>(frame.java:420)     @ java.awt.frame.<init>(frame.java:385)     @ javax.swing.jframe.<init>(jframe.java:180)     @ ..myframe.<init>(myframe.java:23) 

okay, i've found answer. afford! problem had libxtst6 installed 64bit-version of it.

sudo apt-get install libxtst6:i386 did trick me.

how did find answer? ldded around bit, nothing, can see in following:

$ ldd jdk1.7.0_25_x86/jre/lib/i386/xawt/libmawt.so     linux-gate.so.1 =>  (0xf7769000)     libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf76ee000)     libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf76c2000)     libawt.so => jdk1.7.0_25_x86/jre/lib/i386/xawt/../libawt.so (0xf760f000)     libxext.so.6 => /usr/lib/i386-linux-gnu/libxext.so.6 (0xf75fd000)     libx11.so.6 => /usr/lib/i386-linux-gnu/libx11.so.6 (0xf74c9000)     libxrender.so.1 => /usr/lib/i386-linux-gnu/libxrender.so.1 (0xf74bf000)     libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf74ba000)     libxtst.so.6 => /usr/lib/i386-linux-gnu/libxtst.so.6 (0xf74b2000)     libxi.so.6 => /usr/lib/i386-linux-gnu/libxi.so.6 (0xf74a2000)     libjava.so => jdk1.7.0_25_x86/jre/lib/i386/xawt../libjava.so (0xf747e000)     libjvm.so => not found     libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf72d5000)     /lib/ld-linux.so.2 (0xf776a000)     libjvm.so => not found     libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf72b3000)     libjvm.so => not found     libverify.so => java/jdk1.7.0_25_x86/jre/lib/i386/xawt/../libverify.so (0xf72a7000)     libxau.so.6 => /usr/lib/i386-linux-gnu/libxau.so.6 (0xf72a2000)     libxdmcp.so.6 => /usr/lib/i386-linux-gnu/libxdmcp.so.6 (0xf729b000)     libjvm.so => not found 

so point when ended trusting ide , started sample application on command line. , command line again nice me:

$ jdk1.7.0_25_x86/bin/java main exception in thread "main" java.lang.unsatisfiedlinkerror: jdk1.7.0_25_x86/jre/lib/i386/xawt/libmawt.so: libxtst.so.6: cannot open shared object file: no such file or directory     @ java.lang.classloader$nativelibrary.load(native method)     @ java.lang.classloader.loadlibrary1(classloader.java:1957)     @ java.lang.classloader.loadlibrary0(classloader.java:1882)     @ java.lang.classloader.loadlibrary(classloader.java:1843)     @ java.lang.runtime.load0(runtime.java:795)     @ java.lang.system.load(system.java:1061)     @ java.lang.classloader$nativelibrary.load(native method)     @ java.lang.classloader.loadlibrary1(classloader.java:1957)     @ java.lang.classloader.loadlibrary0(classloader.java:1882)     @ java.lang.classloader.loadlibrary(classloader.java:1864)     @ java.lang.runtime.loadlibrary0(runtime.java:849)     @ java.lang.system.loadlibrary(system.java:1087)     @ sun.security.action.loadlibraryaction.run(loadlibraryaction.java:67)     @ sun.security.action.loadlibraryaction.run(loadlibraryaction.java:47)     @ java.security.accesscontroller.doprivileged(native method)     @ java.awt.toolkit.loadlibraries(toolkit.java:1646)     @ java.awt.toolkit.<clinit>(toolkit.java:1668)     @ java.awt.component.<clinit>(component.java:595)     @ main.main(main.java:5) 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -