Coder Social home page Coder Social logo

Comments (5)

tomb50 avatar tomb50 commented on June 8, 2024 1

Hi @mgroth0 thanks for the notes.

Looks like a typo on my part, I did brew install graphviz too - I'll correct the above post.

Interesting to hear that you were able to get it working without any issues around the PATH

I'm assuming that as your use case is a Gradle plugin when you say you are running it through IntelliJ, it is the Intellij Gradle integration that would be executing a Gradle process through a shell, therefore picking up shell environment variables, which would then be passed to the Java process spawned by Gradle - but please advise if this is not the case.

If it is not the case I don't suppose you would be able to set a breakpoint and see System.getenv() to confirm what PATH looks like prior to graphviz being called. It may invalidate some of my understandings above.

Thanks!
Tom

from graphviz-java.

mgroth0 avatar mgroth0 commented on June 8, 2024 1

@tomb50 , I actually adapted the gradle plugin to work inside of a regular kotlin module (not a gradle plugin, but just a regular gradle subproject built in IntelliJ).

I've taken a look atSystem.getenv() info you requested, right before I use graphviz. And here is the value for PATH:

/Users/matthewgroth/miniconda3/bin:/Users/matthewgroth/miniconda3/condabin:/Users/matthewgroth/bin:/Applications/SublimeText.app/Contents/SharedSupport/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin

I've also tried using echo $PATH in the terminal, and the output was the same.

I checked my ~/.zshrc and it doesn't look like I manually add it there. I guess homebrew automatically adds it to the PATH and my gradle/intelliJ environment somehow is passing it through.

Now here's where it gets interesting. I've only been able to get it working inside of a gradle run task and assumed it was working perfectly for me. But just to be sure, I tried executing the jar outside of gradle. And then I did in fact get the infamous None of the provided engines could be initialized exception. So, I do think your initial assumptions were correct.

from graphviz-java.

mgroth0 avatar mgroth0 commented on June 8, 2024 1

One more clarification about my environment. I develop tools for myself using IntellJ/Gradle. Then I often execute them as a daemon process through Lingon.

Originally this library worked only in a gradle run task but not when executing the built jar through Lingon. But, I just discovered that Lingon does allow users to set their environmental variables. So, I set PATH to the correct value in Lingon. Now this library works perfectly for me through Lingon as well.

from graphviz-java.

mgroth0 avatar mgroth0 commented on June 8, 2024

@tomb50 thanks for the incredible work.

I feel bad because I was able to get this working on my M1 Mac with fewer issues than you. But maybe something in my build environment was different, I'm not sure.

I'm trying to run https://github.com/vanniktech/gradle-dependency-graph-generator-plugin in IntelliJ. At first, it did not work. And it complained none of the engines loaded. Eventually, I stumbled upon this post of yours. I realized I did not have dot installed on my new machine.

I first tried brew install dot. This doesn't work.

Next, I tried brew install graphviz. This worked. And pretty much right away, the Gradle plugin started working without any additional steps.

I checked which dot in a terminal and got /opt/homebrew/bin/dot. As you suggest, I'd be surprised if this automatically was passed into whatever search path my java environment is using.

I launch IntelliJ through the JetBrains Toolbox. So it really baffles me how I got it to work so easily without the path issues you describe. I hope this might be helpful to you or others.

from graphviz-java.

caoccao avatar caoccao commented on June 8, 2024

I wonder if you have evaluated Javet (Java + V8) which supports both Mac x86_64 and arm64.

from graphviz-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.