question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Directory configuration not working correctly

See original GitHub issue

OS: MacOS v10.13.4 Java version: JavaSE-1.8 Dotenv version: 3.1.0


When configuring the directory Dotenv uses it seems to make a difference weather or not you use a dot in the path.

The following code works just fine:

Dotenv env = Dotenv.configure().directory("./").load();

However this code throws an error:

Dotenv env = Dotenv.configure().directory("/").load();
Exception in thread "main" io.github.cdimascio.dotenv.DotEnvException: Could not find /.env on the classpath
	at io.github.cdimascio.dotenv.internal.ClasspathHelper.loadFileFromClasspath(ClassPathHelper.kt:28)
	at io.github.cdimascio.dotenv.internal.DotenvReader.read(DotenvReader.kt:26)
	at io.github.cdimascio.dotenv.internal.DotenvParser.parse(DotenvParser.kt:18)
	at io.github.cdimascio.dotenv.DotenvBuilder.load(Dotenv.kt:48)
	at dotenv_test.Main.main(Main.java:9)

Removing the configuration entirely should according to the documentation load the dotenv file from the root of the project: ./ however this throws an error too. Which seems especially weird to me.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jessevdpcommented, Apr 25, 2018

Ahh I see. That’s totally fixed. I included the resources folder under src/main instead of in the root of the project.

0reactions
cdimasciocommented, Apr 25, 2018

Excellent! I added the example to the README. closing this out

Read more comments on GitHub >

github_iconTop Results From Across the Web

Domain controller is not functioning correctly - Windows Server
Provides common resolutions to issues where you cannot open Active Directory snap-ins or connect to a domain controller from another ...
Read more >
Techniques to troubleshoot Active Directory issues - TechTarget
When a problem arises, there are several simple procedures you should follow as part of the process to troubleshoot Active Directory.
Read more >
Directory config name is invalid" | Nutanix Community
I just keep getting the error message "Directory config name is invalid". I can ping the DC host from the CVM using the...
Read more >
Directory Agent cannot connect to the domain controller
Go to the Web > Settings > General > Directory Services page in the TRITON Manager and verify that your directory service configuration...
Read more >
Troubleshooting Open Directory, Part 1 | Computerworld
When Open Directory is properly configured, there's very little troubleshooting that needs to be done; it simply does its job, and everything generally...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found