Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/usr/java/default/bin/jar: No such file or directory #62

Closed
alagna opened this issue Jan 27, 2016 · 16 comments
Closed

/usr/java/default/bin/jar: No such file or directory #62

alagna opened this issue Jan 27, 2016 · 16 comments

Comments

@alagna
Copy link

alagna commented Jan 27, 2016

I tried to build the dockerImages but the script is enforcing the creation of a link ln -s /usr/java/$JAVA_FOLDER that on my mac is not allowed:

dockerfiles alagna>uname -a
Darwin Mac-Book-Pro3-AlbertoLagna.local 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64
dockerfiles alagna>java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)

What can I do to avoid the problem?

See attached complete log
ciao & thanks
Alberto

dockerfiles alagna>eval $(docker-machine env default)
dockerfiles alagna>printenv | grep DOCKER
DOCKER_HOST=tcp://192.168.99.100:2376
DOCKER_MACHINE_NAME=default
DOCKER_TLS_VERIFY=1
DOCKER_CERT_PATH=/Users/alagna/.docker/machine/machines/default
dockerfiles alagna>sh buildDockerImage.sh -v 12.1.3 -s -d

Skipped MD5 checksum.

Building image 'oracle/weblogic:12.1.3-developer' ...
Sending build context to Docker daemon 430.7 MB
Step 1 : FROM oracle/oraclelinux:latest
latest: Pulling from oracle/oraclelinux
8d33cf3cb8b1: Pull complete
8b0a7d9c4e64: Pull complete
465df4f376b5: Pull complete
Digest: sha256:e531a1292086b72b9f9f2633faa25d6fdf1a4a2c629f9abadf36cff21dccd135
Status: Downloaded newer image for oracle/oraclelinux:latest
---> 465df4f376b5
Step 2 : MAINTAINER Bruno Borges bruno.borges@oracle.com
---> Running in 0fedfca7bc79
---> 284dd33eaaac
Removing intermediate container 0fedfca7bc79
Step 3 : ENV JAVA_PKG server-jre-8u65-linux-x64.tar.gz JAVA_FOLDER jdk1.8.0_65 FMW_PKG wls1213_dev_update3.zip JAVA_HOME /usr/java/default MW_HOME /u01/oracle ORACLE_HOME /u01/oracle CONFIG_JVM_ARGS "-Djava.security.egd=file:/dev/./urandom" JAVA_OPTIONS "-XX:+PrintCommandLineFlags -Djava.security.egd=file:/dev/./urandom" JAVA_OPTIONS $JAVA_OPTIONS PATH $PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin
---> Running in 85a0c46da037
---> 4a3970cbcd84
Removing intermediate container 85a0c46da037
Step 4 : COPY $FMW_PKG /u01/
---> 96e40d23626b
Removing intermediate container 8322d75cc0ad
Step 5 : ADD $JAVA_PKG /usr/java/
---> 5eace456b57a
Removing intermediate container 06e61ddba317
Step 6 : RUN chmod a+xr /u01 && useradd -b /u01 -m -s /bin/bash oracle && ln -s /usr/java/$JAVA_FOLDER /usr/java/default && ln -s /usr/java/$JAVA_FOLDER /usr/java/latest && $JAVA_HOME/bin/jar xf /u01/$FMW_PKG && mv wls12130/* /u01/oracle && rmdir wls12130 && cd /u01/oracle && sh configure.sh -silent && find /u01/oracle -name "
.sh" -exec chmod a+x {} ; && rm /u01/$FMW_PKG && chown oracle:oracle -R /u01/oracle && rm -rf /var/cache/yum/

---> Running in 3914c033852a
/bin/sh: /usr/java/default/bin/jar: No such file or directory
Removing intermediate container 3914c033852a
The command '/bin/sh -c chmod a+xr /u01 && useradd -b /u01 -m -s /bin/bash oracle && ln -s /usr/java/$JAVA_FOLDER /usr/java/default && ln -s /usr/java/$JAVA_FOLDER /usr/java/latest && $JAVA_HOME/bin/jar xf /u01/$FMW_PKG && mv wls12130/* /u01/oracle && rmdir wls12130 && cd /u01/oracle && sh configure.sh -silent && find /u01/oracle -name ".sh" -exec chmod a+x {} ; && rm /u01/$FMW_PKG && chown oracle:oracle -R /u01/oracle && rm -rf /var/cache/yum/' returned a non-zero code: 127
There was an error building the image.

@brunoborges
Copy link
Contributor

Update the git repo on your local computer.

@yxwzaxns
Copy link

yxwzaxns commented May 2, 2016

I also encountered the same problem,how to update git repo

@alagna
Copy link
Author

alagna commented May 2, 2016

simply doing a >git pull

@prasenforu
Copy link

same issue "/bin/sh: /usr/java/default/bin/jar: Not a directory"

dockerfiles]$ git pull
Already up-to-date.
[pkar@ip-172-31-19-52 dockerfiles]$ sh buildDockerImage.sh -d -v 12.2.1
Checking if required packages are present and valid...

fmw_12.2.1.0.0_wls_quick_Disk1_1of1.zip: OK

Building image 'oracle/weblogic:12.2.1-developer' ...
Sending build context to Docker daemon 402.7 MB
Step 1 : FROM oracle/jdk:8
---> be2ddf461adf
Step 2 : MAINTAINER Bruno Borges bruno.borges@oracle.com
---> Running in bf9822fd24cc
---> e25f5c906781
Removing intermediate container bf9822fd24cc
Step 3 : ENV FMW_PKG fmw_12.2.1.0.0_wls_quick_Disk1_1of1.zip FMW_JAR fmw_12.2.1.0.0_wls_quick.jar ORACLE_HOME /u01/oracle USER_MEM_ARGS "-Djava.security.egd=file:/dev/./urandom" PATH $PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin
---> Running in 20c47f18fd93
---> 77d3e63d8faf
Removing intermediate container 20c47f18fd93
Step 4 : COPY $FMW_PKG install.file oraInst.loc /u01/
---> 7dd2549fcfde
Removing intermediate container a44a65971d17
Step 5 : ADD $JAVA_PKG /usr/java/
---> 4551748e277e
Removing intermediate container 1f7cb4162286
Step 6 : RUN chmod a+xr /u01 && useradd -b /u01 -m -s /bin/bash oracle && echo oracle:oracle | chpasswd && cd /u01 && $JAVA_HOME/bin/jar xf /u01/$FMW_PKG && cd - && su -c "$JAVA_HOME/bin/java -jar /u01/$FMW_JAR -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME" - oracle && chown oracle:oracle -R /u01 && rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file
---> Running in 9bdce9d534d7
/bin/sh: /usr/java/default/bin/jar: Not a directory
Removing intermediate container 9bdce9d534d7
The command '/bin/sh -c chmod a+xr /u01 && useradd -b /u01 -m -s /bin/bash oracle && echo oracle:oracle | chpasswd && cd /u01 && $JAVA_HOME/bin/jar xf /u01/$FMW_PKG && cd - && su -c "$JAVA_HOME/bin/java -jar /u01/$FMW_JAR -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME" - oracle && chown oracle:oracle -R /u01 && rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file' returned a non-zero code: 126
There was an error building the image.

@lautarochiarle
Copy link

Hi, any updates on this issue? I'm having the same problem using Ubuntu 14.04 when I tried to build the image using this command: ./buildDockerImage.sh -v 12.2.1 -d

@brunoborges
Copy link
Contributor

Please provide detailed information on how you built image oracle/jdk:8

@nicolimo86
Copy link

nicolimo86 commented Oct 14, 2016

Hi all, I pulled everything but I still have this error.
I'm using OSX.

That's how I built oracle/jdk:8 :

$ cd OracleJDK/java-8/
$ mv server-jre-8u101-linux-x64.tar.gz.download server-jre-8u101-linux-x64.tar.gz
$ sh build.sh 
Sending build context to Docker daemon 4.608 kB
Step 1 : FROM oraclelinux:latest
 ---> 3d62999fc909
Step 2 : MAINTAINER Bruno Borges <bruno.borges@oracle.com>
 ---> Using cache
 ---> 213ca79d92f3
Step 3 : ENV JAVA_PKG server-jre-8u101-linux-x64.tar.gz JAVA_HOME /usr/java/default
 ---> Using cache
 ---> caf969d078df
Step 4 : ADD $JAVA_PKG /usr/java/
 ---> Using cache
 ---> 737a6550f248
Step 5 : RUN export JAVA_DIR=$(ls -1 -d /usr/java/*) &&     ln -s $JAVA_DIR /usr/java/latest &&     ln -s $JAVA_DIR /usr/java/default &&     alternatives --install /usr/bin/java java $JAVA_DIR/bin/java 20000 &&     alternatives --install /usr/bin/javac javac $JAVA_DIR/bin/javac 20000 &&     alternatives --install /usr/bin/jar jar $JAVA_DIR/bin/jar 20000
 ---> Using cache
 ---> 56b36be02942
Successfully built 56b36be02942

$ docker build -t oracle/jdk:8 .
Sending build context to Docker daemon 4.608 kB
Step 1 : FROM oraclelinux:latest
 ---> 3d62999fc909
Step 2 : MAINTAINER Bruno Borges <bruno.borges@oracle.com>
 ---> Using cache
 ---> 213ca79d92f3
Step 3 : ENV JAVA_PKG server-jre-8u101-linux-x64.tar.gz JAVA_HOME /usr/java/default
 ---> Using cache
 ---> caf969d078df
Step 4 : ADD $JAVA_PKG /usr/java/
 ---> Using cache
 ---> 737a6550f248
Step 5 : RUN export JAVA_DIR=$(ls -1 -d /usr/java/*) &&     ln -s $JAVA_DIR /usr/java/latest &&     ln -s $JAVA_DIR /usr/java/default &&     alternatives --install /usr/bin/java java $JAVA_DIR/bin/java 20000 &&     alternatives --install /usr/bin/javac javac $JAVA_DIR/bin/javac 20000 &&     alternatives --install /usr/bin/jar jar $JAVA_DIR/bin/jar 20000
 ---> Using cache
 ---> 56b36be02942
Successfully built 56b36be02942


@Djelibeybi
Copy link
Member

$ mv server-jre-8u101-linux-x64.tar.gz.download server-jre-8u101-linux-x64.tar.gz

This is your problem. The .download file is NOT a tarball. It's a text file that tells you where to download the actual server-jre tarball from. View the file, go to the URL, download the binaries and then rebuild your image using the actual tarball itself.

@yxwzaxns
Copy link

@dandan86 you should download server-jre-8u101-linux-x64.tar.gz from a URL, you can get it from server-jre-8u101-linux-x64.tar.gz.download

@nicolimo86
Copy link

@Djelibeybi @yxwzaxns thank you, indeed the problem was that one.

@gunners1990
Copy link

I have downloaded the latest version still I am getting the error.
Can anybody tell me how to resolve it.

@brunoborges
Copy link
Contributor

@gunners1990 please read the README carefully :-)

@gunners1990
Copy link

@brunoborges I will try once again. Thanks for the prompt response.

@guruwiz
Copy link

guruwiz commented Jan 3, 2017

Hi, You should check a jar in JRE directory. In my case, I got the same problem when I downloaded a server-jre-8u111-linux-x64.tar.gz which didn't include jar file

@mrmahesh
Copy link

I am Building the Image in Docker Toolbox

$ sh buildDockerImage.sh -v 12.2.1 -d -s
Skipped MD5 checksum.

Building image 'oracle/weblogic:12.2.1-developer' ...
Sending build context to Docker daemon 324.9MB
Step 1/11 : FROM oracle/serverjre:8
---> 4ae27cc3a146
Step 2/11 : MAINTAINER Bruno Borges bruno.borges@oracle.com
---> Running in 1f0979a4af41
---> cd2bf0920467
Removing intermediate container 1f0979a4af41
Step 3/11 : ENV ORACLE_HOME /u01/oracle USER_MEM_ARGS "-Djava.security.egd=file:/dev/./urandom" PATH $PATH:/usr/java/default/bin:/u01/oracle/oracle_co
mmon/common/bin
---> Running in 01ad54f074c4
---> e63ebfd29036
Removing intermediate container 01ad54f074c4
Step 4/11 : RUN mkdir -p /u01 && chmod a+xr /u01 && useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle
---> Running in 1b605c435198
---> 2c766e6ad1df
Removing intermediate container 1b605c435198
Step 5/11 : ENV FMW_PKG fmw_12.2.1.0.0_wls_quick_Disk1_1of1.zip FMW_JAR fmw_12.2.1.0.0_wls_quick.jar DEBUG_FLAG true PRODUCTION_MODE dev
---> Running in 8dd201180f3a
---> 31b4f29e2150
Removing intermediate container 8dd201180f3a
Step 6/11 : COPY $FMW_PKG install.file oraInst.loc /u01/
COPY failed: stat /mnt/sda1/var/lib/docker/tmp/docker-builder374931965/fmw_12.2.1.0.0_wls_quick_Disk1_1of1.zip: no such file or directory
There was an error building the image.

Help me i am stuck on Step 6.

@Djelibeybi
Copy link
Member

This issue is closed. Please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants