title: Encountered "=" error in Jmeter when List is used in jmeter beanshell code
body: <p>Below is my code. </p>
  
  <pre><code>package findDuplicatre;
  import java.util.*;
  import java.util.Collections;
  import java.util.List;
  import java.util.Scanner;
  
  public class FindDuplicate {
  
  
       public static void main(String[] args) {
           String[] ContentNameCount = {"name1","name1","name2","name2", "name2"};
          List&lt;String&gt; sampleList = (List&lt;String&gt;) Arrays.asList(ContentNameCount);
           for(String inpt:ContentNameCount){
           int frequency=Collections.frequency(sampleList,inpt);
           log.error(inpt+" "+frequency); //System.out.println(inpt+" "+frequency);
           }
       }
  </code></pre>
  
  <p>}</p>
  
  <p>In eclipse i could get results:</p>
  
  <pre><code>    name1 2
      name1 2
      name2 3
      name2 3
      name2 3
  </code></pre>
  
  <p>When i could run the same code in Eclipse without any error.But when i run the same code in jmeter beanshell sampler i'm getting below errors.</p>
  
  <pre><code>Response message: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval  In file: inline evaluation of: ``package findDuplicatre;  import java.util.*; import java.util.Collections; impor . . . '' Encountered "=" at line 13, column 41.
  </code></pre>
  
  <p>Can anyone kindly explain me what am i missing and how would it make difference when i run in beanshell script.</p>