nikku / node-xsd-schema-validator

A schema (XSD) validator for NodeJS
https://www.npmjs.com/package/xsd-schema-validator
MIT License
52 stars 24 forks source link

Error: JDK required at JAVA_HOME or in path to compile helper #18

Closed SantoshSKhavekar closed 5 years ago

SantoshSKhavekar commented 5 years ago

Hi ,I have tried this package on windows and linux systems.In Windows I amgetting proer validation result but in Linux I am getting this Error ,JDK required at JAVA_HOME or in path to compile helper.

I have tried to set JAVA_HOME and PATH in linux as belows, First Searched

whereis java java: /usr/bin/java /usr/java/jdk1.8.0_211-amd64/bin/java /usr/share/man/man1/java.1

setted JAVA_HOME as below export JAVA_HOME=/usr/java/jdk1.8.0_211-amd64

setted PATH as below export PATH=$PATH:$JAVA_HOME/bin

Did echo $JAVA_HOME /usr/java/jdk1.8.0_211-amd64

Did echo $PATH /usr/java/jdk1.8.0_211-amd64/bin

I have verified like this when I ran my project I am getting the error "JDK required at JAVA_HOME or in path to compile helper"

Could guys look at this Issue?

nikku commented 5 years ago

Is your Java a JDK or a JRE? A JDK is required, as stated by the error message.

SantoshSKhavekar commented 5 years ago

Hello Nikku,I have installed JDK.

nikku commented 5 years ago

What is the output of whereis javac?

SantoshSKhavekar commented 5 years ago

javac: /usr/bin/javac /usr/java/jdk1.8.0_211-amd64/bin/javac This is what I am getting for this whereis javac.

nikku commented 5 years ago

Not sure what is going on there.

I suggest you to debug the issue, i.e. via ndb to see exactly what is going on wrong during the lookup.

SantoshSKhavekar commented 5 years ago

Nikku..I am deploying my project with Docker conatiner and earleir I was not added this line ENV JAVA_HOME /usr/java/jdk1.8.0_211-amd64 in Docker file.So I was getting this error ,"spawn javac enoent". After adding this ENV JAVA_HOME /usr/java/jdk1.8.0_211-amd64 in Docker file I am getting "JDK required at JAVA_HOME or in path to compile helper". Even I am also struggling from last week.Please can you help to figure out?

Thanks.

nikku commented 5 years ago

Is java available inside the docker container? Stuff that is available on your local machine is not automatically available inside your containers.

SantoshSKhavekar commented 5 years ago

I have checked this command to verify [root@hc4t06221 ~]# docker exec 7ba961cb9d67 java -version rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"java\": executable file not found in $PATH"

nikku commented 5 years ago

All right then. Closing this issue, as java is simply not packed into your docker container.

SantoshSKhavekar commented 5 years ago

Hi Nikku,

I have solved my Issue by adding these lines,

ENV JAVA_HOME=/usr/lib/jvm/java-1.7-openjdk 
RUN export JAVA_HOME 
ENV PATH="$JAVA_HOME/bin:${PATH}" 
RUN java -version 
RUN javac -version

In my case, javac is not running inside docker container.Now fixed this issue.

joneldiablo commented 3 years ago

could I install the openjdk-14-jdk-headless version to works with this repo?

Nau077 commented 3 years ago

Same error.

2021-10-15T18:48:40: Error: Java JRE required at JAVA_HOME or in path to perform validation

getting this error on alma linux. When project is running on debian I have no problems