As you state, the max. length of a command line in cmd.exe (at the interactive Command Prompt and in batch files) is officially 8,191 characters - see the documentation.
If you try to submit a command line via the Run dialog (Win-R), the limit appears to be even lower.
However, this does not apply to command lines in PowerShell, where the limit is much higher - 32,764 characters.
In other words: commands launched from within PowerShell aren't subject to the 8,191-character limit - irrespective of whether you use Start-Process or Invoke-Expression (neither of which you should use for invoking console applications / scripts - see this answer and this answer) or by direct invocation (by file path, possibly preceded by &, the call operator - e.g., .\javaRun.ps1 or & .\javaRun.ps1) - none of these methods involve cmd.exe
As for calling external programs from PowerShell:
At least .NET-based executables are capable of receiving command lines up to PowerShell's 32,764-character limit.
I don't know about executables using different runtimes, such as java.exe; but if they turn out to be the bottleneck, you won't be able to overcome this problem from PowerShell, and will instead have to find a different way to pass input to the target program, such as via standard input or an aux. file.