DJtheRedstoner/DevAuth

No config-file created

1TheCrazy opened this issue · 2 comments

I recently started using DevAuth for the first time and it just wouldn't create a config.toml file, nor the directory. But it wasn't throwing any errors. The only consequence was, that I couldn't use DevAuth and it always logged: 'DevAuth deisabled, not logging in!'. I tried to set the JVM properties, but cmd threw an error that therre was no base class 'devauth.enabled', the IntelliJ menu Help > Edit Custom VM Properties didn't work (I didn't try the Help > Edit Custom Properties, but I figure it wouldn't have worked aswell) and also the Run > Debug... > Edit Configurations > Environment Variables didn't help. I've never used java or the JVM before, but that was what google suggested to change the JVM properties mentioned in the README.md file.
What I had to do to get it working in the end, was to create the directory myself and configure the config.toml file like this:

defaultEnabled = true

defaultAccount = "main"

# An example mojang account
[accounts.main]
type = "microsoft"

[accounts.alt]
type = "microsoft"

I tried backtracking throught the code in the repository to find why it didn't throw any errors or created a default config(DevAuthJava l.33) but couldn't find the reason.
For my project I'm using Java 8 as a Project SDK (if that helps to find the source of the issue) and I'm on Windows 11

Hi, there seems to be confusion here, which makes sense since IntelliJ doesn't exactly make this obvious... I'll try to clear this up:

the IntelliJ menu Help > Edit Custom VM Properties

This is for properties for the JVM instance that runs the IntelliJ IDEA, which is completely separate from any programs run through IntelliJ. You should only change these options if you are trying to modify the behavior of IntelliJ itself.

Run > Debug... > Edit Configurations > Environment Variables

Environment variables aren't the same thing as JVM properties, however this is almost the correct place. JVM properties are set by adding -D<name>=<value> to the JVM arguments. In order to add JVM arguments in IntelliJ, you need to click "Modify Options" near the top right of the Run Configuration dialog (the same place where you can set normal arguments and environment variables), then select "Add VM Options". This will add a new field labeled "VM Options" to the run config dialog, where you can then add your JVM properties.

Hope this helps!

Closing since I assume this is resolved.