# Minecraft Java client cannot login



## jbo (Oct 3, 2021)

I've compiled & installed games/minecraft-client. Here's the output of launching `minecraft-client` the first time:

```
jbo@fbsd_beefy01 /u/h/jbo [127]> minecraft-client
Bootstrap (v5)
Current time is Oct 3, 2021 12:54:10 PM
System.getProperty('os.name') == 'Linux'
System.getProperty('os.version') == '13.0-RELEASE-p4'
System.getProperty('os.arch') == 'amd64'
System.getProperty('java.version') == '1.8.0_302'
System.getProperty('java.vendor') == 'OpenJDK BSD Porting Team'
System.getProperty('sun.arch.data.model') == '64'

Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma
Got reply in: 441ms
Downloaded 1076.7kb in 0s at 1421.6kb/s
Renaming /home/jbo/.minecraft/launcher.pack.lzma.new to /home/jbo/.minecraft/launcher.pack.lzma
Renamed successfully.
Reversing LZMA on /home/jbo/.minecraft/launcher.pack.lzma to /home/jbo/.minecraft/launcher.pack
Unpacking /home/jbo/.minecraft/launcher.pack to /home/jbo/.minecraft/launcher.jar
Cleaning up /home/jbo/.minecraft/launcher.pack
Starting launcher.
[12:54:13 INFO]: Minecraft Launcher 1.6.89-j (through bootstrap 5) started on linux...
[12:54:13 INFO]: Current time is Oct 3, 2021 12:54:13 PM
[12:54:13 INFO]: System.getProperty('os.name') == 'Linux'
[12:54:13 INFO]: System.getProperty('os.version') == '13.0-RELEASE-p4'
[12:54:13 INFO]: System.getProperty('os.arch') == 'amd64'
[12:54:13 INFO]: System.getProperty('java.version') == '1.8.0_302'
[12:54:13 INFO]: System.getProperty('java.vendor') == 'OpenJDK BSD Porting Team'
[12:54:13 INFO]: System.getProperty('sun.arch.data.model') == '64'
[12:54:13 INFO]: proxy == DIRECT
[12:54:13 INFO]: Refreshing local version list...
[12:54:13 INFO]: Refreshing remote version list...
[12:54:13 INFO]: Refresh complete.
[12:54:13 INFO]: Loaded 0 profile(s); selected '(Default)'
```

When the login screen shows up, the following message is displayed in a dialog box:

```
Before starting MineCraft, be sure to open your Profile and set the Java Executable to: '/usr/local/share/minecraft-client/minecraft-runtime'
```

Unfortunately I have not a clue what that message is trying to tell me. Which profile? What?

Ignoring that message and moving on with the login process the following shows up in the terminal:

```
[13:02:15 INFO]: Logging in with username & password
[13:02:15 ERROR]: Couldn't log in
com.mojang.authlib.exceptions.InvalidCredentialsException: Invalid credentials. Invalid username or password.
    at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:63) ~[launcher.jar:1.6.89-j]
    at com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication.logInWithPassword(YggdrasilUserAuthentication.java:74) ~[launcher.jar:1.6.89-j]
    at com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication.logIn(YggdrasilUserAuthentication.java:57) ~[launcher.jar:1.6.89-j]
    at net.minecraft.launcher.ui.popups.login.LogInForm$4.run(LogInForm.java:171) [launcher.jar:1.6.89-j]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_302]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_302]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302]
```

Can anybody share any light on this? Clearly I'm supposed to do something but I fail to understand what.


----------



## Alexander88207 (Oct 3, 2021)

Hello jbodenmann,

the port minecraft-client used to provide the original java packed launcher. Now that microsoft only provides closed binaries for each platform it is not so easy to play mincraft anymore.

The launcher is outdated and does not support newer versions.

We (a few others and myself on the freebsd discord) use multimc to play more modern versions.

Here is a small rundown what is to do:

(Please dont follow it blindly)

0.5 `cd $HOME`

1.`fetch "https://reviews.freebsd.org/D31119.diff"`
2. `doas git apply $HOME/D31119.diff`
3. `cd /usr/ports/lwjgl3`
4. `doas pkg install apache-ant glfw multimc openjdk16 devel/dyncall pkgconf` (Install Build & Run deps)
5. `doas make install clean`
6. `doas pkg remove apache-ant devel/dyncall pkgconf`(Remove Build deps)
7. `cd $HOME && fetch "https://git.cameronkatri.com/freebsd-ports/plain/games/multimc/files/multimc-minecraft-runtime?h=main"`
8. `doas mv "multimc-minecraft-runtime?h=main" /usr/local/share/multimc`
9. `doas chmod +x "/usr/local/share/multimc/multimc-minecraft-runtime?h=main"`
10. Start mutlimc in the terminal with `multimc` and enjoy!


----------



## Alexander88207 (Oct 3, 2021)

Important: In the instance settings the downloaded and moved script must be selected as java runtime.


----------



## jbo (Oct 3, 2021)

Hey Alexander88207 

Thank you for the provided information. I will try to understand what's happening there and give it a shot.
From what I understand, the games/multimc port is unusitable (for newer minecraft versions) because of the dependency to games/lwjgl which would need to be updated to at least version 3.0.
Does anybody know how much effort this would be?

With the information you outlined above, are you able to play Minecraft 1.17.1?

I haven't really touched minecraft since 2012 so I might be lacking some vital an/or obvious information here.


----------



## Alexander88207 (Oct 3, 2021)

jbodenmann said:


> Hey Alexander88207
> 
> Thank you for the provided information. I will try to understand what's happening there and give it a shot.
> From what I understand, the games/multimc port is unusitable (for newer minecraft versions) because of the dependency to games/lwjgl which would need to be updated to at least version 3.0.
> ...



LWJGL3 have been submitted as https://reviews.freebsd.org/D31119.

I do have included this in my rundown where i do fetch and apply this patch directly.


----------



## Alexander88207 (Oct 3, 2021)

jbodenmann said:


> With the information you outlined above, are you able to play Minecraft 1.17.1?



Yes


----------



## jbo (Dec 15, 2021)

Alexander88207 I'm looking at that patch you linked every now and then as I'd really love to get the latest minecraft client(s) running on FreeBSD. But given how little time I invest into gaming these days I'd also prefer not to mess around with it too much so I decided to just sit tight and wait for progress on this.

Do you have any insights / connections to the patch submitter that would allow us to guestimate whether the patch will be landing any time soon? Seems like revision(s) were requested 2 months ago.

As usual I am not trying to pressure or stress anybody. I'm fairly familiar with the process of working on OSS projects - especially the spare time component associated with that. I merely mean to inquire some information to manage expectations.


----------



## jardows (Dec 15, 2021)

Alexander88207 said:


> Hello jbodenmann,
> 
> the port minecraft-client used to provide the original java packed launcher. Now that microsoft only provides closed binaries for each platform it is not so easy to play mincraft anymore.
> 
> ...


Thanks for the write-up.  I'm having a problem applying the patch though in my testing machine.  When I run `git apply /usr/ports D31119.diff` I get the message 
	
	



```
error: git apply: failed to read: Is a directory
```
I am running as root (I don't have doas or sudo installed) and have tried from within the home folder and writing out the full path.


----------



## jbo (Dec 15, 2021)

jardows I haven't tried to apply the patch but from what I can tell you'll have to apply it from /usr/ports.


----------



## jardows (Dec 15, 2021)

jbodenmann said:


> jardows I haven't tried to apply the patch but from what I can tell you'll have to apply it from /usr/ports.


I make my current directory /usr/ports, and then ran:

```
git apply /home/myhomedirectory/D31119.diff
```
and that worked.  I'm building lwjgl now.

Edit:  So far, so good.  During first startup, I had to manually point the program to use the openjdk16 install at /usr/local/openjdk16/bin/java

Now to see if I can figure out the account login part!


----------



## Alexander88207 (Dec 15, 2021)

jbodenmann said:


> Do you have any insights / connections to the patch submitter that would allow us to guestimate whether the patch will be landing any time soon? Seems like revision(s) were requested 2 months ago.



Hello,

unfortunately not. You may want to ask him nicely by e-mail or directly in the review.


----------



## jardows (Dec 16, 2021)

So I have encountered another problem.  I'm pretty new to playing Minecraft, and apparently all new accounts are Microsoft accounts, but the version of multimc in ports (0.6.11) does not support logging in with Microsoft accounts, while the current version (0.6.14) does.  It's getting late, so I'll look at what needs done to get 0.6.14 running.


----------



## jardows (Dec 16, 2021)

I submitted https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260471 for updating the port to .0.6.14 so that Microsoft account logins can work.


----------



## jbo (Dec 16, 2021)

jardows while you wait you might look into updating the port yourself 

I don't know the software but usually version bumps (especially build/patch version updates) tend to be rather easy.


----------



## MrRed (Feb 7, 2022)

Well I just compiled the MultiMC 0.6.14, I got it launching. But when I go into "Accounts" I see the button "Add Microsoft" but I can't click on it for some reasons (light gray)... No log error nothing, just "Disabled"...


----------

