0

I am getting the below error:

C:\Users\Think\AndroidStudioProjects\Calculator\app\src\main\java\com\lolodmc70\HomeActivity.java:84: error: cannot access Expression
                Expression exp = new Expression(userexp);
                ^
  bad class file: C:\Users\Think\AndroidStudioProjects\Calculator\app\libs\MathParser.org-mXparser.jar(/org/mariuszgromada/math/mxparser/Expression.class)
    class file has wrong version 62.0, should be 55.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

Here is the code

import androidx.appcompat.app.AppCompatActivity;

equals.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                String userexp = operation.getText().toString();
                userexp.replaceAll("÷","/");
                userexp.replaceAll("×","*");

                Expression exp = new Expression(userexp);
                String result = String.valueOf(exp.calculate());

                operation.setText(result);
                operation.setSelection(result.length());

            }
        });
Abhishek Dutt
  • 1,308
  • 7
  • 14
  • 24
  • Does this answer your question? [Class file has wrong version 52.0, should be 50.0](https://stackoverflow.com/questions/28180915/class-file-has-wrong-version-52-0-should-be-50-0) – Abhishek Dutt Oct 15 '22 at 10:27

1 Answers1

0

The essential part of your error is

class file has wrong version 62.0, should be 55.0

So check the JDK and JRE versions you use to compile and run the project.

Queeg
  • 7,748
  • 1
  • 16
  • 42