Eclipse error: NoClassDefFoundError: java/lang/ref/FinalReference

旧时模样 提交于 2019-11-28 10:02:17
  1. Find Running configurations -> java application
  2. In the new configuration's Classpath tab, find "Android Library" under Bootstrap Entries and remove it.
  3. Still in the Classpath tab, select Bootstrap Entries and click the Advanced button.
  4. Choose Add Library and click OK.
  5. Select JRE System Library and click Next.
  6. Select Workspace Default JRE and click Finish.

Based on http://www.frickingnutz.com/files/android_pdf/FAQs.pdf

I have been frustrated by this error for several days, by comparing with my colleagues Eclipse preferences with mine, the problem was fixed by changing the Java compliance level from 1.7 to 1.6. This will also change the generated .class files and source compatibility to 1.6.

If you tried running a specific java class, then every time you click the run button it will default to whatever you tried to run last.

Click the drop down beside the run button and choose specifically what you want to run.

Go to "run configuirations" under the "run" menu. Select the delete run menu. Do a clean and then you should be back and running again.

Jousse Veliz

I was trying to use all the answers above but it doesn´t work.

This error happened when I wrote 1 method that returned a String [][] ( don't know why yet) but the error doesn't disappear when I disable (/* */) the method.

Finally I did 2 things:

  1. Created a new Android Project and copy the files. rebuild the Activity.java and the manifest.xml.

    It worked until I activate the method then the same error all over again:

    VM java/lang/NoClassDefFoundError: java/lang/ref/FinalReference and then

    Error occurred during initialization of VM and no matter what I do, it didn´t work until I create another Android Project.

  2. So the 2nd thing I did was :

    Run-> Run Configurations->Java Application and click on New_Configuration then I clicked on the red X above (Delete selected launch configuration) and it worked ( not the method but the program worked when I /* */ it.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!