Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gui script fails to start on Mac OS Sierra - ilegal option -- f #207

Open
jsotuyod opened this issue Apr 8, 2017 · 7 comments
Open

Gui script fails to start on Mac OS Sierra - ilegal option -- f #207

jsotuyod opened this issue Apr 8, 2017 · 7 comments
Labels

Comments

@jsotuyod
Copy link

jsotuyod commented Apr 8, 2017

The script fails on MacOS with:

$ ./gui
readlink: illegal option -- f
usage: readlink [-n] [file ...]
@cinquin
Copy link
Contributor

cinquin commented Apr 11, 2017

We're going round in circles on this issue; see the history of the script.
It would be nice if someone could sit down and find a way of setting up the script in a way that works reliably on all platforms (or, failing that, detects the platform and switches behavior accordingly).

@cinquin cinquin mentioned this issue Apr 11, 2017
@PhRX
Copy link
Contributor

PhRX commented Apr 11, 2017

TL;DR : proposal = drop the scripts, use gradle facilities (or maven if it can do it)

The crux of the problem AFAICS is that tools.jar must be on the classpath, which requires the script to be non-trivial (trivial would be to just use the jar).

My proposal for resolving this issue, as well as #122 is in #187 : if we switch to gradle (although for all I know the same can be achieved using maven - can anyone comment?) it can be used instead of the generated scripts. In gradle it's easy to declare the necessary dependency on what is used from the tools.jar.

The end result is that when the hp project is checked out, all that is needed to run the UI is the command ./gradlew run. A ./gradlew runConsole (or something similar) can be added trivially to start the console.

AFAIK, the gradle solution would work on any platform (OSX, Linux, Windows - the only one I haven't tried for now is OSX). The wrapper mechanism (which uses the gradlew script which is checked in, with a version both for Win and non-Win) ensures you don't even need to install gradle.

The above is for people who have a JDK installed (gradle will compile and create the jar the first time). If only a JRE is available, we can use a deployment module for gradle (such as https://github.com/shemnon/javafx-gradle) which allows building of a distribution. I've successfully used it in the past to create a self-contained zip/tgz which contains a Win or nonWin executable running the project. The JRE is also included. This I could do in less than half a day.
I think the JDK itself also contains deployment tools these days, those could be used too.

@fzh890523
Copy link

fzh890523 commented Dec 26, 2017

on OSX, you can install greadlink via "brew install greadlink" and then use this script content below to replace that in GUI script:

#!/bin/sh

set -eu

java_path=$(greadlink -f $(which javac))
[ -f /usr/libexec/java_home ] && java_home=/usr/libexec/java_home || java_home=$(echo ${java_path} | sed 's/javac$//')
tools_path="$java_home/lib/tools.jar"
[ -f ${tools_path} ] || (echo "Could not find tools.jar at ${tools_path}" && exit 1)

BASEDIR=$(dirname "$0")

java -cp $tools_path:${BASEDIR}/honest-profiler.jar com.insightfullogic.honest_profiler.ports.javafx.JavaFXApplication

@nitsanw
Copy link
Member

nitsanw commented Apr 3, 2018

Is this still an issue?

@nitsanw nitsanw added the bug label Apr 3, 2018
@snowe2010
Copy link

@nitsanw this is still an issue.

@nitsanw
Copy link
Member

nitsanw commented Aug 3, 2018

@snowe2010 I don't have a Mac to test on, so sadly can't help. Please try the workaround above, and report back. If you can resolve the issue and contribute a PR that would be great.

@snowe2010
Copy link

Workaround for me was brew install coreutils and then doing as said. I'm not experienced in this area, so I'm not sure I could submit an effective PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants