title: Java: my distrib differs from IDE debugging
body: <p>When I read from text file (UTF-8) by NetBeans IDE it reads both English and Russian letters correctly, but when I build distrib, run it and read the same file it doesn't recognize Russian letters(i guess it will happen with any language other than English). </p>
  
  <p>What am I missing?</p>
  
  <p><img src="https://img607.imageshack.us/img607/1558/javabug.jpg"> [dead link to <a href="https://img607.imageshack.us/img607/1558/javabug.jpg" rel="nofollow noreferrer">https://img607.imageshack.us/img607/1558/javabug.jpg</a> ]</p>
  
  <p>update:
  How I read text file(I excluded all redundant for the case code):</p>
  
  <pre><code>bReader = new BufferedReader(new FileReader(fileName));
  String tempString;
  tempString = bReader.readLine();
  if ((tempString.length() &gt;= 1) &amp;&amp; (tempString.substring(0, 1).equals(""))) {
      tempString = tempString.substring(1);
  }
  //^^^ Former excludes UTF-8 Character at the beginning of a file
  //it is actually placed in "", but it can't be seen here
  while (tempString != null) {
      tempString = bReader.readLine();
  }
  </code></pre>
  
  <p>So nothing really fancy here</p>
  
  <p>What sir qrtt1 suggested in the comments below actually works, that is</p>
  
  <blockquote>
    <p>try add encoding configuration to vm: java -Dfile.encoding=utf-8 your_main_class</p>
  </blockquote>
  
  <p>Now I wonder how I can change my program without explicitly adding this parameters</p>