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

Cannot install any Java version #830

Open
Quinten0508 opened this issue Jan 17, 2022 · 3 comments
Open

Cannot install any Java version #830

Quinten0508 opened this issue Jan 17, 2022 · 3 comments

Comments

@Quinten0508
Copy link

Running Windows 11, PS 5.1
Every time I use jabba install <version> it gives me this error:

Invoke-Expression : At line:1 char:1534
+ ... calCache\local-packages\Python39\Scripts;"C:\WINDOWS\System32;C:\WIND ...
+                                               ~~~~~~~~~~~~~~~~~~~
Unexpected token 'C:\WINDOWS\System32' in expression or statement.
At C:\Users\Quint\.jabba\jabba.ps1:11 char:40
+ ...        if (-not $expression -eq "") { Invoke-Expression $expression }
+                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ParserError: (:) [Invoke-Expression], ParseException
    + FullyQualifiedErrorId : UnexpectedToken,Microsoft.PowerShell.Commands.InvokeExpressionCommand

However, using jabba ls does list the newly installed java version.
jabba current returns nothing, thus I tried jabba use <version>, but this gave the same error as jabba install above:

Invoke-Expression : At line:1 char:1534
+ ... calCache\local-packages\Python39\Scripts;"C:\WINDOWS\System32;C:\WIND ...
+                                               ~~~~~~~~~~~~~~~~~~~
Unexpected token 'C:\WINDOWS\System32' in expression or statement.
At C:\Users\Quint\.jabba\jabba.ps1:11 char:40
+ ...        if (-not $expression -eq "") { Invoke-Expression $expression }
+                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ParserError: (:) [Invoke-Expression], ParseException
    + FullyQualifiedErrorId : UnexpectedToken,Microsoft.PowerShell.Commands.InvokeExpressionCommand

I already had Java openjdk 1.8.0_292 installed prior to installing jabba, but when using jabba current or jabba ls this does not show up and instead returns nothing.
I've tried running the PS window with administrator.

@sytolk
Copy link

sytolk commented Feb 16, 2022

for me jdk is installed but cannot use it on Windows 11

C:\Windows\system32>jabba use [email protected]

C:\Windows\system32>java -version
'java' is not recognized as an internal or external command,
operable program or batch file.

C:\Windows\system32>jabba current

C:\Windows\system32>jabba ls
[email protected]

C:\Windows\system32>

@arbaleast
Copy link

I have encountered the same problem, even if I restart PowerShell in Windows11

❯ jabba ls
liberica@1.16.0
liberica@1.8.292-10
❯ jabba use liberica@1.16.0
❯ java --version
java: The term 'java' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

@arbaleast
Copy link

❯ $psversiontable                                                                                                                                       Name                           Value
----                           -----
PSVersion                      7.2.6
PSEdition                      Core
GitCommitId                    7.2.6
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

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

No branches or pull requests

3 participants