title: Can I run a java jar program with ssh?
body: <p>I want to run a Java program using ssh, I've copied my private keys and I can run simple linux commands.</p>
  
  <p>If run this command from the server I can see all the directories</p>
  
  <pre><code>ssh user@192.168.1.2 pwd
  </code></pre>
  
  <p>However I want to run a Java jar app, like this:</p>
  
  <pre><code>ssh user@192.168.1.2 java -Djava.library.path=myapp/. classpath=myapp/myapp.jar:. myClass
  </code></pre>
  
  <p>This is how I exactly run my app in the client machine: </p>
  
  <pre><code>java -Djava.library.path=myapp/. classpath=myapp/myapp.jar:. myClass
  </code></pre>
  
  <p>I got this error, obviously, java is installed</p>
  
  <pre><code>java: command not found
  </code></pre>