build issue
I installed node-java 0.8 on ubuntu14.04.
I am using node java for nw js(0.22.3) so tried to build with nw-gyp, first configured like this inside node java
nw-gyp configure --target=0.22.3
Now build
nw-gyp build --target=0.22.3
Build is failing with following errors
SOLINK_MODULE(target) Release/obj.target/nodejavabridge_bindings.node
/usr/bin/ld: cannot find -ljvm
collect2: error: ld returned 1 exit status
make: *** [Release/obj.target/nodejavabridge_bindings.node] Error 1
make: Leaving directory /home/cronj-10/Sarvani/offline-sample-app/node_modules/java/build' gyp ERR! build error gyp ERR! stack Error: make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/nw-gyp/lib/build.js:294:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:194:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 3.13.0-115-generic
gyp ERR! command "/home/cronj-10/.nvm/versions/node/v7.9.0/bin/node" "/usr/local/bin/nw-gyp" "build" "--target=0.22.3"
gyp ERR! cwd /home/cronj-10/Sarvani/offline-sample-app/node_modules/java
gyp ERR! node -v v7.9.0
gyp ERR! nw-gyp -v v3.4.0
gyp ERR! not ok
I have java 1.8 and JAVA_HOME is set. When I do it with node-gyp it works but I need the same for nw js.
Please help with the issue.
check your software-properties-common python-software-properties and build-essential automake gcc g++ clang installation
tested it with docker 14.04
- create container instance from ubuntu 14.04 - then like in dockerfile
- RUN apt-get update -y --fix-missing
- RUN apt-get install -y software-properties-common python-software-properties
- RUN apt-get -y install curl build-essential automake gcc g++ clang libssl-dev
- RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
- RUN add-apt-repository -y ppa:webupd8team/java
- RUN apt-get update -y
- RUN apt-get install -y oracle-java8-installer
- RUN rm -rf /var/lib/apt/lists/*
- RUN rm -rf /var/cache/oracle-jdk8-installer
- ENV JAVA_HOME /usr/lib/jvm/java-8-oracle (export JAVA_HOME=/usr/lib/jvm/java-8-oracle)
- ENV PATH ${JAVA_HOME}/bin:$PATH (export PATH=$JAVA_HOME/bin:$PATH)
- RUN java -version
- ENV NVM_DIR /usr/local/nvm (export NVM_DIR=/usr/local/nvm)
- ENV NODE_VERSION 7.10.0 (export NODE_VERSION=7.10.0)
- curl https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | bash
- source $NVM_DIR/nvm.sh
- nvm install $NODE_VERSION
- nvm alias default $NODE_VERSION
- nvm use default
- ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules (export NODE_PATH=$NVM_DIR/v$NODE_VERSION/lib/node_modules)
- ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH (export PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH)
- RUN node --version
- RUN npm i -g nw-gyp
- RUN cd
- RUN npm init --yes
- RUN npm i java
- RUN cd node_modules/java/
- RUN nw-gyp configure --target=0.22.3
- RUN nw-gyp build --target=0.22.3
all done! all fine!
I have similar problem while installing on Raspberry Pi 3. I have found the root of the issue. Script which searches for java lib dir ( find_java_libdir.sh ) returned path "/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/arm/server", but in fact there is no "server" directory. Instead there is directory "client". It seems that my issue is related to the https://www.raspberrypi.org/forums/viewtopic.php?t=197824