title: How do I insert a string variable into my step definition in Cucumber-JVM?
body: <p>I'd want to insert a predefined string into my step definition in Cucumber using java. Here's what I have:</p>
  
  <p><strong>Java</strong> Code</p>
  
  <pre><code>public String temp = "hello";
  //insert temp into my step:
  @Then("^the "+temp+" should be empty$")
  public void the_should_be_empty() throws Throwable {
      //do things
  }
  </code></pre>
  
  <p>But I keep getting this <strong>error</strong>:</p>
  
  <blockquote>
    <p>"The value for annotation attribute Then.value must be a constant
    expression"</p>
  </blockquote>
  
  <p>So, <strong>how do I insert a string into</strong> my capturing <strong>step</strong>?</p>
  
  <p>=============</p>
  
  <h1>More Info</h1>
  
  <p>I am trying to have a set list of "global keywords" used in many of my BDD step definitios. So when I add a new "global keyword", it will be changed in all my BDD. For example <code>(red|yellow|green)</code> could be used in 10 different BDD steps, and I want to add <code>blue</code> without changing all 10 steps. Instead I want a String variable that contains the list, then insert this variable into my BDD.</p>