Tag Archives: BeanShell

BeanShell error: error invoking BSH method: Eval [How to Solve]

Cause: read the contents of CSV file in BeanShell. The same code can be executed in idea, but an error is reported in BeanShell:

ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval In file: inline evaluation of: “import java.io.BufferedReader; import java.io.FileReader; import java.util.Array . . . ” Encountered “=” at line 9, column 24.

Delete the string specified in the list and run it again. The operation is successful

Guess: generics in Java are not supported in BeanShell.

About BeanShell error invoking BSH method

 

Background: due to testing needs, we intend to reference. Java and. Class files from the outside, but the error is lingering: error invoking BSH method: eval

After learning from various Baidu, baidu decided to abandon the reference first and try whether BeanShell can run normally. Fortunately, the result is satisfactory

Special attention:

1. Double quotation marks are used for setting variables. There are differences between single quotation marks and double quotation marks
2. L in println is lowercase of L, not uppercase of I

 

Reference. Class file:

addClassPath(“D:\\”);

 

Reference. Java file:

source(“D:\\test.java”);