You will have to specify the full location uri of the JAR file in REGISTER command, like this
REGISTER hdfs://your_jar_file_path
OR
REGISTER hdfs://ip-172-31-53-48.ec2.internal:8020/your_jar_file_path
Where ip-172-31-53-48.ec2.internal is the hostname of namenode which we can find in Ambari