sdkman available to root user but not to other users
Asked Answered
B

2

10

I installed sdkman as a root user using curl in CentOS 6.8 I installed Grails using sdkman and it is only available to the root user.

Do I need to install sdkman as other regular user in order for Grails to work or is there a way to use Grails I installed as a root user?

Thank you.

Bantustan answered 18/8, 2016 at 15:12 Comment(5)
if you install it in /root/bin/ e.g. then it's only there for root. put it into /usr/local/bin e.g. for all users.Terzas
"...or is there a way to use Grails I installed as a root user" - Running Grails as root is a bad idea.Jocosity
@JeffScottBrown, No, no. I meant use Grails as a regular user but somehow have access to Grails.Bantustan
@cfrick, So I noticed my Grails, PostgreSQL, pgAdmin3 are all not available to regular users... Do I need to move them to /usr/local/bin as well?Bantustan
if your tools like psql are not available to all users, then many things can be wrong on that system (or right: e.g. permissions set restrictive). if you have concrete programming problems, please formulate them. if you have questions regarding system administration then maybe the superuser SE might be a better place to ask them.Terzas
F
11

I'd encourage you to make sdkman available to other users (look at its Docs, paragraph Custom Installation, add init script that sources init file from $SDKMAN_DIR/bin directory).

Then have users who want Grails install it.

Or install Grails via its repository (accepting, that this will be an older version than one from SDKMAN).

In my case I used:

  1. export SDKMAN_DIR="/usr/local/sdkman" && curl -s "https://get.sdkman.io" | bash - make sure $SDKMAN_DIR doesn't exist before you install sdkman as it will be overwritten otherwise
  2. In .bashrc files for users I wanted to be able to use sdkman. AT THE VERY END of these otherwise, it may not work
export SDKMAN_DIR="/usr/local/sdkman"
[[ -s "/usr/local/sdkman/bin/sdkman-init.sh" ]] && source "/usr/local/sdkman/bin/sdkman-init.sh"

Docs: https://sdkman.io/install

Freda answered 15/9, 2017 at 9:18 Comment(1)
source .bashrc -bash: export: [[': not a valid identifier -bash: export: -s': not a valid identifier -bash: export: /usr/local/sdkman/bin/sdkman-init.sh': not a valid identifier -bash: export: ]]': not a valid identifierChildbed
A
2
  1. For non-interactive shell add into .profile

    export SDKMAN_DIR="/usr/local/sdkman"

    [[ -s "/usr/local/sdkman/bin/sdkman-init.sh" ]] && source "/usr/local/sdkman/bin/sdkman-init.sh"

Aldous answered 9/12, 2021 at 14:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.