Giter Club home page Giter Club logo

Comments (6)

cdimascio avatar cdimascio commented on May 27, 2024

@Playacem I've modified the default path to "./", rather than "". Based on your description I'm hoping this resolve the Windows issue. Hoping you might verify once again

see this change: https://github.com/cdimascio/java-dotenv/blob/master/src/main/kotlin/io/github/cdimascio/dotenv/Dotenv.kt#L49

assuming it looks good, i'll generate a new release

from dotenv-kotlin.

Playacem avatar Playacem commented on May 27, 2024

Sadly the fix does not seem to fix the issue.

Initialization code: Dotenv ENV = Dotenv.configure().load();
The .env file exists in the working directory (E:\Dev\Project)

Exception:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at playacem.Main.setupLogging(Main.java:63)
	at playacem.Main.main(Main.java:19)
Caused by: io.github.cdimascio.dotenv.DotEnvException: Could not find /.env on the classpath
	at io.github.cdimascio.dotenv.internal.ClasspathHelper.loadFileFromClasspath(ClassPathHelper.kt:32)
	at io.github.cdimascio.dotenv.internal.DotenvReader.read(DotenvReader.kt:34)
	at io.github.cdimascio.dotenv.internal.DotenvParser.parse(DotenvParser.kt:22)
	at io.github.cdimascio.dotenv.DotenvBuilder.load(Dotenv.kt:52)
	at playacem.util.env.Config.<clinit>(Config.java:9)
	... 2 more
	Suppressed: io.github.cdimascio.dotenv.DotEnvException: Could not find \.env on the file system (working directory: E:\Dev\Project)
		at io.github.cdimascio.dotenv.internal.DotenvReader.read(DotenvReader.kt:38)
		... 5 more

I build the current master branch and used mvn install to install into my local m2 repository.

from dotenv-kotlin.

cdimascio avatar cdimascio commented on May 27, 2024

Thanks @Playacem. Bummer. Looks like i need to set up a windows VM to explore this. If you feel comfortable, feel free to dig in as well. I'm happy to accept a PR.

from dotenv-kotlin.

Playacem avatar Playacem commented on May 27, 2024

@cdimascio I just realized that I did not test the change properly. My IDE did not recognize the change of versions properly and used the old version of java-dotenv.

The fix does indeed work!

from dotenv-kotlin.

cdimascio avatar cdimascio commented on May 27, 2024

Fantastic! Thanks so much for helping me with the resolution.

from dotenv-kotlin.

cdimascio avatar cdimascio commented on May 27, 2024

i'll roll a new version shortly

from dotenv-kotlin.

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.