sirin05137 / CSE364_Project

2 stars 0 forks source link

ENV and java command issue #2

Closed yuujinleee closed 3 years ago

yuujinleee commented 3 years ago

When root@1ed18ee799fe:~/project# sh run.sh inside the docker container,

root@1ed18ee799fe:~/project# sh run.sh
Cloning into 'CSE364_Project'...
remote: Enumerating objects: 80, done.
remote: Counting objects: 100% (80/80), done.
remote: Compressing objects: 100% (53/53), done.
remote: Total 80 (delta 23), reused 60 (delta 11), pack-reused 0
Unpacking objects: 100% (80/80), 8.41 MiB | 5.11 MiB/s, done.
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
Error: Could not find or load main class xxx.yyy.YourClass
Caused by: java.lang.ClassNotFoundException: xxx.yyy.YourClass
  1. ENV JAVA_HOME issue in dockerfile?

    ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java

    referred doc : https://felixgondwe.medium.com/set-java-home-on-ubuntu-docker-container-e302a7aa45ad

  2. Should java command in the run.sh be modified? it takes only 1 case of inputs

    java -cp target/cse364-project-1.0-SNAPSHOT-jar-withdependencies.jar xxx.yyy.YourClass Adventure educator
sirin05137 commented 3 years ago

Theres piazza question related to #2 https://piazza.com/class/km1t4q5ekt33t4?cid=16

yuujinleee commented 3 years ago

Hey guys.

  1. Issue #2.1 closed

    #this is dockerfile
    ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64

    and also I added the locale settings in dockerfile for the platform encoding.

    #this is inside the container
    root@5fffdf1cde6c:~/project# mvn -version
    Apache Maven 3.6.3
    Maven home: /usr/share/maven
    Java version: 11.0.10, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
    Default locale: ko_KR, platform encoding: UTF-8
    OS name: "linux", version: "4.19.121-linuxkit", arch: "amd64", family: "unix"

    The link I referred to (just for the record, you dont have to view it): https://www.edureka.co/community/71310/java-should-point-environment-variable-defined-correctly

  2. Issue #2.2 temporary closed

For the convenience I will remove(put the # on) the java command in run.sh for now. You can check it in the latest commit on master.

++ theres Build Failure (maven compiling) issue in run.sh but I will post it as a new issue (#4).