Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save noahcoad/92133670d6189440f883d9369211aeca to your computer and use it in GitHub Desktop.
Save noahcoad/92133670d6189440f883d9369211aeca to your computer and use it in GitHub Desktop.
Install java and nodejs for AWS Greengrass

How to install the java and nodejs dependencies for AWS Greengrass

Greengrass v1.7 specifically supports Java 8 and NodeJS 6.10, and it requires the binaries be in the PATH and a specific file name.

On an Amazon Linux 2 AMI EC2 Instance

# install java
sudo yum install -y java-1.8.0-openjdk
sudo mv /usr/bin/java /usr/bin/java8
    
# install nodejs
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
nvm install 6.10
sudo cp ~/.nvm/versions/node/v6.10.3/bin/node /usr/bin/nodejs6.10

On Ubuntu 16.04

# install java
sudo apt-get install default-jre
sudo mv /usr/bin/java /usr/bin/java8

# install nodejs
curl -o- -L -k https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
nvm install 6.10
sudo cp ~/.nvm/versions/node/v6.10.3/bin/node /usr/bin/nodejs6.10

Misc

  • Other OS's like Raspberry Pi or Ubuntu coming.
  • Greengass v1.8 is about to be released, so will update with that once tested
  • For systemd service to launch greengrass, see greengrass.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment