Coder Social home page Coder Social logo

Comments (4)

garvincasimir avatar garvincasimir commented on September 14, 2024

I have a bunch of unsynced commits that makes a bunch of improvements and resolves the other issues. Thanks for finding this one. You saved me a bunch of debugging time. I will change the code so that JAVA_HOME is provided as an argument to the elasticsearch process. My ideal would be to install java to a custom directory and not have to mess with environment variables and the registry. The only problem with that approach is, in my view, the best way to know if java is installed is to read the registry. Lastly for the java and elasticsearch processes I am capturing StandardError once the process has ended. I will look into enabling events for trace information like you have.

from elasticsearch-azure-paas.

garvincasimir avatar garvincasimir commented on September 14, 2024

I was wrong. Don't know why I thought the batch file accepted java_home as an argument. However, I should be able to set custom Environment variables for the process and achieve the same effect. The reason elasticsearch isn't exiting is a "pause" in the batch script when it encounters the no JAVA_HOME error.

from elasticsearch-azure-paas.

garvincasimir avatar garvincasimir commented on September 14, 2024

So the JAVA_HOME issue is related to how processes get their environment variables. Apparently, they inherit them from their calling process. When you call SetEnviromentVariable a broadcast message (WM_SETTINGCHANGE) is sent to all processes informing them of the change. This is an async processes so even if your process handles that message, your operation which depends on the updated value could very well occur before this message is received. You can read more here.

from elasticsearch-azure-paas.

tormodu avatar tormodu commented on September 14, 2024

By setting the JAVA_HOME variable like this:

Environment.SetEnvironmentVariable(JAVA_HOME, javaHome, EnvironmentVariableTarget.Process);

The variable gets picked up immediately and a recycle is not needed

from elasticsearch-azure-paas.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.