title: Java Hibernate Different Behavior between starting jar from console and explorer with double click
body: <p>In my JavaFx project I use Hibernate to connect to a local Postgresql database.
  In Intellij the project runs and the connection works. Also when I start the formed jar from the console everything works and the data can be read.
  However when I start the jar from the explorer with a double click it does not work. Also no error is given.</p>
  <pre><code>@FXML
  protected void onHelloButtonClick() {
          System.out.println(&quot;Test&quot;);
          welcomeText.setText(&quot;Welcome to JavaFX Appdssdasdalication!&quot;);
  
          try{
              Session session = HibernateUtil.getSession();
              Alert alert = new Alert(Alert.AlertType.INFORMATION);
              alert.setTitle(&quot;Information Dialog&quot;);
              alert.setHeaderText(&quot;Look, an Information Dialog&quot;);
              alert.setContentText(&quot;test&quot;);
              alert.showAndWait();
              session.beginTransaction();
  
  
  
              Name name = new Name();
              name.setEmail(&quot;p.gue@gmail.com&quot;);
              name.setEmployeeId(1);
  
              session.save(name);
  
              session.getTransaction().commit();
  
  
              session.beginTransaction();
  
              String email = session.get(Name.class, 1).getEmail();
              welcomeText.setText(email);
              alert = new Alert(Alert.AlertType.INFORMATION);
              alert.setTitle(&quot;Information Dialog&quot;);
              alert.setHeaderText(&quot;Look, an Information Dialog&quot;);
              alert.setContentText(email);
  
              alert.showAndWait();
              //welcomeText.setText(((Name)session.createQuery(&quot;From Name&quot;).list().get(0)).getEmail());
              session.getTransaction().commit();
  
              HibernateUtil.shutdown();
          }catch(Exception e){
              welcomeText.setText(e.toString());
  
              Alert alert = new Alert(Alert.AlertType.INFORMATION);
              alert.setTitle(&quot;Information Dialog&quot;);
              alert.setHeaderText(&quot;Look, an Information Dialog&quot;);
              alert.setContentText(e.toString());
  
              alert.showAndWait();
          }
  
          welcomeText.setText(&quot;Welcome to sadssaddsadsaasd Appdssdasdalication!&quot;);
  
      }
  </code></pre>
  <p>the first test alert is not opened when started via double click.</p>
  <p>Java JDK 16.</p>
  <p>Thanks for your help!</p>