Code Monkey home page Code Monkey logo

Comments (9)

samperman avatar samperman commented on May 21, 2024

It looks like this is happening because java/attribibutes/default.rb is computing the value of node['java']['java_home'] before my override values take effect. This leaves java_home in a bad state.

I've working around this issue by creating my own cookbook that depends on your cookbook but adds the following block first:

# java_home may have been computed too early. reload the attributes to fix it
b = ruby_block 'reset_java_home' do
  block do
    node.load_attribute_by_short_filename('default', 'java')
  end
  action :nothing
end

# run this action immediately. if I don't do this it either never runs (action :nothing)
# or runs too late (action :create)
b.run_action(:create)

Maybe java_home should be computed inside the recipe after all attribute overrides have been applied?

from java.

carmstrong avatar carmstrong commented on May 21, 2024

What version of the cookbook are you using? I'm wondering if you see the same behavior with the latest, 1.16.2. If not, this is definitely a bug - JAVA_HOME should most certainly match the jdk you're actually using :(

from java.

samperman avatar samperman commented on May 21, 2024

This was with version 1.15.4.

I'm wondering if (pull request 95)[https://github.com//pull/95] will fix this issue though. It looks like it.

from java.

carmstrong avatar carmstrong commented on May 21, 2024

Yeah, that's what I was thinking. If you're still seeing issues after upgrading, there's a bug to fix.

from java.

samperman avatar samperman commented on May 21, 2024

Looks like it is fixed in 1.16.2.

from java.

mylons avatar mylons commented on May 21, 2024

@samperman it does sound like #95 would fix this -- it's one of the reasons I submitted that request

from java.

samperman avatar samperman commented on May 21, 2024

Thanks for the fix!

from java.

carmstrong avatar carmstrong commented on May 21, 2024

Glad this is sorted!

from java.

lock avatar lock commented on May 21, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from java.

Related Issues (20)

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.