title: My jar runs on Ubuntu but not Windows
body: <p>I have created a Java project in NetBeans and the automatically built distribution file (.jar) runs absolutely fine on my Ubuntu 15.04 AMD64 machine. </p>
  
  <p>I wanted to make sure it runs on windows before I distribute it, but having tested on a windows 7 32 bit machine I found it doesn't work. Below is a screen shot of the error message.</p>
  
  <p><img src="https://i.stack.imgur.com/s2pSq.png" alt="The error shown on windows terminal"></p>
  
  <p>I can guess at some issues - in that it talks about a .regex error. I don't really use regex in my code but use String.split which I think calls on the regex package - that is in my constructor for the FileHandler class. So it looks like that is an issue. </p>
  
  <p>You can see the full code here on GitHub :</p>
  
  <p><a href="https://github.com/samredway/PwStore/tree/master/src/com/redway_soft/pwstore" rel="nofollow noreferrer">https://github.com/samredway/PwStore/tree/master/src/com/redway_soft/pwstore</a></p>
  
  <p>The Java version on the target machine is: 1.8.0_45
  As is the same on my build machine.</p>
  
  <p>Any help much much appreciated.</p>
  
  <p>EDIT the specific section causing the problem seems to be the constructor for my FileHandler class. Which looks like this:</p>
  
  <pre><code>public FileHandler() {       
  
      String path = this.getClass().getProtectionDomain().getCodeSource()
              .getLocation().toString().substring(5);
  
      String[] arry_path = path.split(File.separator);
  
      path = "";
      for (int i = 0, j = arry_path.length - 1; i &lt; j; i++) {
          path += arry_path[i] + File.separator;
      }
  
      PASSWORDS = path + "data" + File.separator + "passwords.sec";
  
  }
  </code></pre>