Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation error on windows 11 using WSL 2 #776

Open
danny-weiss opened this issue Jun 24, 2024 · 5 comments
Open

Installation error on windows 11 using WSL 2 #776

danny-weiss opened this issue Jun 24, 2024 · 5 comments
Labels
question Issue is a question

Comments

@danny-weiss
Copy link

I've been trying to install this but keep getting this error log:

  ERROR: JAVA_HOME is set to an invalid directory: /mnt/c/Program Files/Java/jdk-1.8

  Please set the JAVA_HOME variable in your environment to match the
  location of your Java installation.


  ERROR: JAVA_HOME is set to an invalid directory: /mnt/c/Program Files/Java/jdk-1.8

  Please set the JAVA_HOME variable in your environment to match the
  location of your Java installation.


  ERROR: JAVA_HOME is set to an invalid directory: /mnt/c/Program Files/Java/jdk-1.8

  Please set the JAVA_HOME variable in your environment to match the
  location of your Java installation.

  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-req-build-gysc0w83/setup.py", line 222, in <module>
      prep_mcp()
    File "/tmp/pip-req-build-gysc0w83/setup.py", line 201, in prep_mcp
      raise e
    File "/tmp/pip-req-build-gysc0w83/setup.py", line 198, in prep_mcp
      subprocess.check_call('{} downloadAssets'.format(gradlew).split(' '), cwd=workdir)
    File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['./gradlew', 'downloadAssets']' returned non-zero exit status 1.
  [end of output]

I think my java is set up wrong but when I do java -version on my WSL and command line I get 1.8.x,
I set up the java_home variable with these commands:
setx JAVA_HOME "C:\Program Files\Java\jdk-1.8"
setx WSLENV "JAVA_HOME/p"

And it seems to be pointing to the right file, but the program can't recognize it as a java file maybe?

@Miffyli
Copy link
Contributor

Miffyli commented Jun 30, 2024

Hey. I think the paths should point to C:\Program Files\Java\jdk-1.8\bin. Also, you should usually have to set these paths, as they are usually set while installing. You know things work when java and javac commands work.

@Miffyli Miffyli added the question Issue is a question label Jun 30, 2024
@danny-weiss
Copy link
Author

I tried setting the JAVA_HOME path to C:\Program Files\Java\jdk-1.8\bin but it unfortunately didn't work.
But also, I discovered that when I set the JAVA_HOME variable to C:Program Files, java -version still works and returns java 1.8
I think it's not the JAVA_HOME variable that makes java work but a path variable to C:Program Files\Common Files\Oracle\Java\Javapath

@Miffyli
Copy link
Contributor

Miffyli commented Jul 2, 2024

@danny-weiss I unfortunately do not have much concrete tips to give here. But I do know that you should have java and javac commands available anywhere in the system (and also in the WSL, since you are on Windows) to be able to install. I would personally just reinstall things if env variables were screwed up like that 😅

@danny-weiss
Copy link
Author

I've tried uninstalling and reinstalling the WSL but it didn't really work, is there an alternative bash command line I can use?

@Miffyli
Copy link
Contributor

Miffyli commented Jul 15, 2024

@danny-weiss Unfortunately I do not have any additional tips to give here. There was a more hacky approach to do this installation by using mingw (installing it, pointing to the right bash.exe, etc), but that has been finnicky to setup and not highly recommended.

The main thing you need is the bash and the commands used by this script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issue is a question
Projects
None yet
Development

No branches or pull requests

2 participants