1

I'm getting a NoClassDefFoundError when I use javax.swing.Timer.

I've added the JRE in installed JREs as described here. I then added the library into the projects java build path and ticked the library in the order and export tab (not sure if that was needed). I am able to import the method but when I run the project I get the error.

04-13 11:56:06.896: E/AndroidRuntime(4139): java.lang.NoClassDefFoundError: javax.swing.Timer

When I restart eclipse I notice the jre7 library is no longer in the projects build path.

Not sure if the problem is related to the eclipse.ini file or the project's .classpath file. I've tried project clean etc but cant find a solution online. I even tried adding the rt.jar from jre7 as external jar but then the project failed to launch. Everything else works, I just cant use swing methods.

eclipse.ini

    -startup
    plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
    --launcher.library
    plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20140116-2212
    -product
    org.eclipse.epp.package.java.product
    --launcher.defaultAction
    openFile
    --launcher.XXMaxPermSize
    256M
    -showsplash
    org.eclipse.platform
    --launcher.XXMaxPermSize
    256m
    --launcher.defaultAction
    openFile
    --launcher.appendVmargs
    -vmargs
    -Dosgi.requiredJavaVersion=1.6
    -Xms40m
    -Xmx512m

.classpath

    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con"        path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con"         path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
    </classpath>
Community
  • 1
  • 1
user3528766
  • 109
  • 1
  • 12

0 Answers0