nikku / node-xsd-schema-validator

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

Bitbucket pipeline: Error: Java SDK required at JAVA_HOME or in path to compile validation helper #30

Closed ivcho02 closed 2 years ago

ivcho02 commented 2 years ago

Hi team, Hope that you are well!

I am trying to use this validator on a Bitbucket pipeline, but unfortunately, the build ends with the following error:

Error: Java SDK required at JAVA_HOME or in path to compile validation helper

Docker image is: node:10.15.3

I couldn't find a way to install java on the Bitbucket virtual machine. The error is thrown on the npm ci step when this dependency is tried to be installed.

Do you have any ideas on how to install java-sdk from the bitbucket-pipeline.yml file?

ps. It's working perfectly on my machine (I have java-sdk installed on my computer)

Kind Regards, Ivo

nikku commented 2 years ago

I don't have an idea unfortunately I'd suggest you to use another docker image (that contains node AND java).

ivcho02 commented 2 years ago

Hi @nikku , Thanks for your reply, I will try to find such an image.

ivcho02 commented 2 years ago

Hi team, I found a solution without changing the docker image:

bitbucket-pipelines.yml

Before npm install put this:

script:
      # Install Java
      - apt-get update
      - apt-get install software-properties-common -y
      - add-apt-repository ppa:openjdk/ppa
      - apt-get install openjdk-8-jdk -y
      - npm ci

Hope it helps.

Best Regards, Ivo

ivanfretes commented 1 year ago

I have the same error i verified my JAVA_HOME env but, this is ok