Server error when opened from shell script

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
rgrwtrs

Server error when opened from shell script

Post by rgrwtrs »

Hello everyone,

I am having an issue with a server that I am running. I am using the Remote PC server. This server allows me to use an app on my tablet (or phone) to control my laptop. When I open terminal and execute this command "java -jar ~/RemotePC/RemotePCServer.jar", the server starts up and works flawlessly.

I wanted to create a shell script that I can just click on and have the server start. I created a file containing the following:
#!/bin/sh
java -jar ~/RemotePC/RemotePCServer.jar

I made it executable and when I click on the file, if it is in the same folder as the jar file and other files the server uses, it runs fine. If i create a launcher, or move the file to another location (like the desktop) it runs the server, but when I try to do remote desktop it gives me this error:

IOException (SnimkovaniObrazovkyVlakno): Can't read input file!
Exception in thread "Thread-4" java.lang.NullPointerException
at thread.SnimkovaniObrazovkyVlakno.run(SnimkovaniObrazovkyVlakno.java:87)

Usually on my tablet I will be able to see and navigate the desktop. When I get this error, i can still control the mouse, but I don't see the desktop. Is there something I am missing that I need to do in order to run a server from a luancher or file that is not located in the same folder as the server files?

I am using linux mint 12 gnome3.

If you need any more info please let me know.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Oscar799
Level 20
Level 20
Posts: 10405
Joined: Tue Aug 11, 2009 9:21 am
Location: United Kingdom

Re: Server error when opened from shell script

Post by Oscar799 »

Moved here by moderator
Image
Locked

Return to “Scripts & Bash”