Run a jar that calls a method http post

I have an application in netbeans that calls http post method passes a few parameters. When I run the application in netbeans it works fine and returns the 200 response code while exporting and executing the relative jar returns me response code 400. Thank s

Can you ,please, show you source code? It will help to understand what is wrong.