title: How to fix string too long exception in java
body: <p>I have a algorithm to analysis string but it take only about 10000 characters more than that it will throw following exception</p>
  
  <pre><code>Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - constant string too long
  </code></pre>
  
  <p>this is the code I'm using </p>
  
  <pre><code>public static void printRepeatingStrings(String inputString, int sequenceLength) {
      if (inputString.isEmpty() || sequenceLength &lt;= 0 || sequenceLength &gt;= inputString.length()) {
          System.out.println("Invalid input");
      } else {
          int i = 0;
          int j = i + sequenceLength;
          Set&lt;String&gt; tempSet = new HashSet&lt;&gt;();
          Set&lt;String&gt; repeatingSequences = new TreeSet&lt;&gt;();
          while (j &lt;= inputString.length()) {
              if (!tempSet.add(inputString.substring(i, j))) {
                  repeatingSequences.add(inputString.substring(i, j));
              }
              i++;
              j = i + sequenceLength;
          }
          for (String str : repeatingSequences) {
              System.out.println(str);
          }
      }
  }
  </code></pre>
  
  <p>If you can help me to fix this that will be very helpful </p>