coder / deploy-code-server

Deploy code-server to the cloud with a few clicks ☁️ 👨🏼‍💻
MIT License
874 stars 647 forks source link

java not installing #62

Closed N30Z3N closed 2 years ago

N30Z3N commented 3 years ago
Step 6/14 : RUN heroku plugins:install java

 ---> Running in 57dc79ca6c15

/bin/sh: 1: heroku: not found

The command '/bin/sh -c heroku plugins:install java' returned a non-zero code: 127

I also tried sudo apt-get install openjdk-8-jre which is mainly i want even that getting error

bpmct commented 3 years ago

What was the error with sudo apt-get install openjdk-8-jre? I believe this is the way to install Java

N30Z3N commented 3 years ago

What was the error with sudo apt-get install openjdk-8-jre? I believe this is the way to install Java

same error

bpmct commented 2 years ago

Hi - sorry for the late response. I have not been active on this repo.

You can install Java in your project by adding this to the Dockerfile:

USER root

# Install "software-properties-common" (for the "add-apt-repository")
RUN apt-get update && apt-get install -y \
    software-properties-common

## Install Oracle's JDK
# add oracle jdk repository
RUN add-apt-repository ppa:ts.sch.gr/ppa \
# accept oracle license
  && echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections \
  && echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections \
  && apt-get update \
# install oracle jdk 8 and make it default
  && apt-get -y install oracle-java8-installer \
  && apt-get -y install oracle-java8-set-default \
# clean up
  && apt-get clean all \
  && rm -rf /var/lib/apt/lists/*

USER coder
bpmct commented 2 years ago

Ah, it looks like Java 8 is not supported on Debian 11. You can, however, use:

RUN sudo apt-get update && sudo apt-get install -y openjdk-11-jre

see this for workarounds: https://www.itzgeek.com/how-tos/linux/debian/how-to-install-java-jdk-on-debian-11.html