effekt icon indicating copy to clipboard operation
effekt copied to clipboard

Binary on Ubuntu 16.04

Open b-studios opened this issue 4 years ago • 7 comments

On Ubuntu 16.04 it has been reported that Effekt cannot be exeucted since java -jar is treated as one command instead of a command and an argument.


The Effekt "binary" is created by prefixing:

#! /usr/bin/env java -jar

to the jar file itself. Installing it with npm makes the binary available (almost) platform independently. In particular on Windows, npm analyses the shebang and automatically generates scripts that correctly start Effekt by invoking java -jar.

We could change the shebang to

#! java -jar

which seems to work on MacOS X, Windows 10 and Ubuntu 16.04 -- however, now we cannot start Effekt as a subprocess from node. This is necessary to start the language server in the VSCode extension.

b-studios avatar Apr 15 '20 07:04 b-studios

I could also reproduce the bug on a fresh 18.04 VM:

$ effekt
/usr/bin/env: 'java -jar': No such file or directory

b-studios avatar Apr 15 '20 08:04 b-studios

As a workaround, one can of course run java -jar /usr/local/bin/effekt, but this is not satisfactory. However, getting vscode on Ubuntu to work is a bit more tricky since adjusting the path in the settings will not work for reasons similar to the ones described above.

b-studios avatar Apr 15 '20 08:04 b-studios

A more reliable workaround is the following:

Create a script effekt.sh with the following contents:

#!/bin/bash
java -jar /usr/bin/local/effekt $@

and make it executable. Put this script in your PATH and use effekt.sh instead of effekt. This also works for VSCode:

  • Enter settings
  • navigate to Effekt / path to executable
  • enter effekt.sh (or the absolute path to the script) there

This solution also interacts well with updating the effekt package. Since the script only forwards to effekt, updating it under the hood just works.

b-studios avatar Apr 15 '20 08:04 b-studios

As a workaround I added the script to the distribution (87a4b0) and link it as effekt.sh. So linux users for now need to call effekt.sh instead of effekt. Also VSCode can now be configured to point to effekt.sh if effekt does not work.

b-studios avatar Apr 15 '20 08:04 b-studios

This needs to be documented on the website.

b-studios avatar Apr 16 '20 19:04 b-studios

So why not just pass -S to env to make it recognize the multiple arguments?

waterlens avatar Oct 23 '22 05:10 waterlens

So why not just pass -S to env to make it recognize the multiple arguments?

This -S flag breaks on windows :(

JonathanStarup avatar Nov 08 '22 15:11 JonathanStarup