Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

achartengine demo compiling, but runtime error

I followed demo instructions on page http://www.achartengine.org/content/goodies.html

i successfully imported the demo project, but every chart give throws a NoClassDefFoundError at runtime, similar to this:

java.lang.NoClassDefFoundError:
org.achartengine.model.XYMultipleSeriesDataset

achartengine-1.0.0.jar is on build path, and it is reported under 'Referenced Libraries'. I guess this is a newbie problem, but I decided to report it since I just imported the demo project 'as is' and tried to run it on my phone.

Do I need other steps, not listed on 'goodies' page?

like image 455
Shine Avatar asked May 03 '12 14:05

Shine


People also ask

Why do I get runtime errors when I compile and run?

When you click Compile and Run, your code is checked against the sample input and sample output by running it against multiple test files that aren’t visible to you. Runtime errors may occur because of the following reasons: Read the problem statement again, understand it, and write code to solve all the possible scenarios.

What is compile-time error?

All these errors are detected by the compiler and thus are known as compile-time errors. Below is an example to demonstrate Compile-Time Error: Run-Time Errors: Errors which occur during program execution (run-time) after successful compilation are called run-time errors.

How does compile and run work with multiple test files?

When you click Compile and Run, your code is checked against the sample input and sample output by running it against multiple test files that aren’t visible to you. Runtime errors may occur because of the following reasons:


1 Answers

I found a good answer on google groups, tested it and it seems to be working:

The only thing that I have ever came across in this case is the export of the jar ... if that makes sense.

In Eclipse:

  1. Right click your project - go to build path - select Configure build path
  2. go to the "Order and Export" tab
  3. Check the "achartengine-1.0.0.jar box and then single click its name
  4. move it up so its right below the Android dependancies (sometimes this can make a difference if you have multiple Jars)

click ok then clean your project. (Project -> Clean...)

like image 199
Shine Avatar answered Oct 20 '22 09:10

Shine