0

There is a .jar file that runs AEM (Adobe Experience Manager) Author instance once I double-click it. I wanted to run it from command line java -jar cq-author-p4502.jar, but it does something differently than when I double-click it. It serves me a web page for product registration.

So, I assume that double-clicking cq-author-p4502.jar doesn't do the same thing as java -jar cq-author-p4502.jar. Where could I find out what is being executed on double-click on .jar file on Mac?

gicig
  • 334
  • 3
  • 14
  • Look [this](http://stackoverflow.com/questions/18858363/executing-a-jar-on-mac-10-8) post. – burakozgul Aug 16 '16 at 08:04
  • 1
    Is the `license.properties` file available in the same folder as the jar file. If so, it shouldn't redirect you to product registration page. – rakhi4110 Aug 16 '16 at 08:24
  • Yes, the `license.properties` file is in the same folder as the `.jar` file. There happens to be difference if I run it from the actual directory in comparison to when I run it from another directory. When I run it from the actual directory everything is fine. However, when I run it from elsewhere it shows me this page for product registration. That was the problem. – gicig Aug 16 '16 at 09:16

1 Answers1

1

In Finder, right click the jar file and select Open With, then take a good look at what is selected as the default application. On El Capitan the default is Jar Launcher.app

On OSX there is a command line tool called open which does almost the same thing as double clicking in Finder. Perhaps the way to get the behavior you want from the command line is this.

open cq-author-p4502.jar -a "/System/Library/CoreServices/Jar Launcher.app"
adkisson
  • 425
  • 4
  • 6
  • This is a way to run this file with no problem from elsewhere on the system, not only from the actual directory where the file is contained. Thanks. – gicig Aug 16 '16 at 09:21