-1

I have application, which analyzing website by scheduler. Its a jar file, and works fine when I run it on my pc (I start it through console). I rent cloud server on Ubuntu 19.10 to deploy my app there. I use Putty to connect to server. I already figured how to install jdk on it:

root@5-63-152-221:~# java -version
openjdk version "11.0.5-ea" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5-ea+10-post-Ubuntu-0ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.5-ea+10-post-Ubuntu-0ubuntu1, mixed mode, sharing)

And through wget (link) command downloaded my jar file from file hosting to server. In logs it says that file saved in "angF". After commnad ls:

root@5-63-152-221:~# ls
angF  virt-sysprep-firstboot.log

How can I find my app on my server and run it? It's my first meeting with Ubuntu, and hope to get some useful advices.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
VoidCat
  • 67
  • 2
  • 2
  • 8

3 Answers3

0

Use file command to check file type is Java archive data (JAR) first.

$ file angF

If yes, just run:

$ java -jar angF
dsewnr
  • 23
  • 8
  • It show this: angF: HTML document, UTF-8 Unicode text, with very long lines, with CRLF, LF line terminators – VoidCat Nov 04 '19 at 18:42
  • And after java -jar angF: Error: Invalid or corrupt jarfile angF – VoidCat Nov 04 '19 at 18:47
  • There's page redirecting on your file hosting, so you can not download it directly by wget. Try to send file to server by [`pscp`](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) command from your pc. i.e. `pscp c:\documents\info.txt userid@server.example.com:/tmp/foo/info.txt` – dsewnr Nov 05 '19 at 00:25
  • Thanks, your comment helped me. – VoidCat Nov 05 '19 at 17:07
0

can you be more elaborate about how you are starting your application in your local machine, that way someone can help you more, but assuming that you have all the required resources to start the application in jar

simply use the command

java -jar jar_file_name

pavan kumar
  • 823
  • 6
  • 15
0

I figured it out: 1) Put my jar file, putty.exe and pscp.exe in the same folder; 2) Opened console there and printed pscp.exe MyFile.jar root@5.63.152.221:/root/; 3) Entered password; 4) Through putty connected to server and run it. Hope someone find it useful.

VoidCat
  • 67
  • 2
  • 2
  • 8