title: My Greenfoot Program works as a greenfoot file but not a jar file
body: <p>I am making a little arcade full of Vocabulary Games for school. When I run the program in the greenfoot window, it runs perfectly. But when I make a jar file of it, it stops when it is Prompted with Greenfoot.ask(). Here's the code:</p>
  
  <pre><code>import greenfoot.*;
  import java.util.*;
  import java.io.*;
  import java.lang.*;
  
  public class Vocabulary 
  {
     static ArrayList&lt;World&gt; back = new ArrayList&lt;World&gt;();
     static String vocab_List;
     static Scanner list =  null;
     static ArrayList&lt;String&gt; last = new ArrayList&lt;String&gt;();
     static Scanner all;
     static ArrayList&lt;String&gt; problems = new ArrayList&lt;String&gt;();
     static Map&lt;String, String&gt; answers = new HashMap&lt;String, String&gt;();
     static int x2 = 0;
     static int y = 1;
     static int count= 0;
     static boolean an;
     static World help;
     static int right = 0;
  
     public static boolean run() throws IOException
     {      
         right = 0;
         Collections.shuffle(problems);
        for(int x = 0; x &lt; 3; x++)
        {
           String[] def = answers.get(problems.get(x)).split(" ");
           String answer = Greenfoot.ask("What does " + problems.get(x) + " mean?");
           count = 0;
           for(String temp: def)
           {
              if(answer.contains(temp))
                 count++;
           }
           if(count &gt; def.length/2 &amp;&amp; count &gt; 1 || count == def.length)
           {
              help.showText("Correct",300,100);
              Greenfoot.delay(50);
              right++;
           }
           else
           {
              help.showText("Actually... it means " + answers.get(problems.get(x)), 300, 100);
              Greenfoot.delay(50);
           }
           if(right &gt;= 2)
           {
              an = true;
           }
           else
           {
               an = false;
           }
           try 
              {
              Thread.sleep(1000); 
           } 
           catch (InterruptedException e) 
           {
              e.printStackTrace();
           }      
           help.showText("",300,100);
        }
        return an;
     }
  
     public static boolean run(int num) throws IOException
     {      
        right = 0;
        Collections.shuffle(problems);
        for(int x = 0; x &lt; num; x++)
        {
           String[] def = answers.get(problems.get(x)).split(" ");
           String answer = Greenfoot.ask("What does " + problems.get(x) + " mean?");
           count = 0;
           for(String temp: def)
           {
              if(answer.contains(temp))
                 count++;
           }
           if(count &gt; def.length/2 &amp;&amp; count &gt; 1 || count == def.length)
           {
              help.showText("Correct",300,100);
              Greenfoot.delay(50);
              right++;
           }
           else
           {
              help.showText("Actually... it means " + answers.get(problems.get(x)), 300, 100);
              Greenfoot.delay(50);
           }
           if(right &gt;= num/2)
           {
              an = true;
           }
           else
           {
               an = false;
           }
           try 
              {
              Thread.sleep(1000); 
           } 
           catch (InterruptedException e) 
           {
              e.printStackTrace();
           }      
           help.showText("",300,200);
        }
        return an;
     }
  
     public static void setBack(World world)
     {
         back.add(world);
     }
     public static void setMode(ArrayList&lt;Integer&gt; lesson) throws IOException
     {
         problems.clear();
         answers.clear();
         x2 = 0;
         all = new Scanner(new File("All_Vocab.in"));
         for(int x : lesson)
         {
             list = new Scanner(new File("Vocab " + x + ".in"));
           while(all.hasNextLine())
           {
              last.add(all.nextLine() + "\n");
           }
           FileWriter fw = new FileWriter("All_Vocab.in");
              BufferedWriter bw = new BufferedWriter(fw);
           for(int c = 0; c &lt; last.size(); c++)
           {
              bw.write(last.get(c));
           }
           bw.write(vocab_List+".in");
           bw.close();
           while(list.hasNextLine())
           {
               problems.add(list.nextLine());
               answers.put(problems.get(x2), list.nextLine());
               x2++;
           }
         }
  
     }
  
     public static void setHelp(World hell)
     {
         help = hell;
      }
  }
  </code></pre>
  
  <p>If you need the whole project, just tell me and I'll share it.</p>