Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Java LTS is linked to 17.0.1 but actually installs 1.8 #1245

Closed

Description

@dsyer
$ env | grep JAVA
JAVA_ROOT=/home/codespace/.java
JAVA_HOME=/opt/java/lts
$ ls -l /opt/java/lts
lrwxrwxrwx 1 codespace codespace 6 Dec 10 19:56 /opt/java/lts -> 17.0.1

and

$ /opt/java/17.0.1/bin/java -version
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_265-b01)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.265-b01, mixed mode)

It's kind of baffling. Doesn't happen for all codespaces, but it does seem reliably always to fail with this one: https://github.com/xmolecules/jmolecules-integrations (whether I open in browser or in vscode locally).

Activity

  1. Chuxel commented on Jan 10, 2022

    @Chuxel
    Member

    Dave Syer (@dsyer) Is this in the default codespaces image or something else?

    joshspicer Can you connect with William on this? I assume its dynamic injection related.

  2. dsyer commented on Jan 10, 2022

    @dsyer
    Author

    Dave Syer (@dsyer) Is this in the default codespaces image or something else?

    I assume. All I do is open a codespace from Github in the browser. Does it remember anything about previous sessions with this repo?

  3. Chuxel commented on Jan 10, 2022

    @Chuxel
    Member
  4. added
    bug
    on Jan 10, 2022
  5. joshspicer commented on Jan 11, 2022

    @joshspicer
    Contributor

    Dave Syer (@dsyer) Is this in the default codespaces image or something else?

    I assume. All I do is open a codespace from Github in the browser. Does it remember anything about previous sessions with this repo?

    It appears the repo you linked doesn't supply its own devcontainer.json with a custom image, so in that case it will use the default image.

    You can also validate this by running the command devcontainer-info in your terminal. The "Definition ID" for the default image is codespaces-linux.

  6. dsyer commented on Jan 11, 2022

    @dsyer
    Author
    $ devcontainer-info
    
    Development container image information
    
    - Image version: 1.7.0
    - Definition ID: codespaces-linux
    - Source code repository: https://github.com/microsoft/vscode-dev-containers/
    - Source code release/branch: v0.209.6
    - Timestamp: Tue, 14 Dec 2021 00:28:37 GMT
    
    More info: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/codespaces-linux/history/1.7.0.md
    

    Why would it be any different for you?

  7. joshspicer commented on Jan 11, 2022

    @joshspicer
    Contributor

    We use Oryx to dynamically install the correct languages/sdks/etc for the source code of your repo. I suspect there is a bug in how oryx is determining which version of java to install for your specific repo (will need to investigate a bit more)

  8. Chuxel commented on Jan 11, 2022

    @Chuxel
    Member

    joshspicer The odd thing is that a repository with no contents results in 17 being linked to JDK 8.... that's the bit that is shocking. I think it might be that the default symlink is wrong and that in cases where autodetection kicks in it works - not sure. Very odd.

  9. joshspicer commented on Jan 21, 2022

    @joshspicer
    Contributor

    image

  10. dsyer commented on Jan 24, 2022

    @dsyer
    Author

    How can I test this? It is still broken if I open a new codespace on that project above?

  11. joshspicer commented on Jan 24, 2022

    @joshspicer
    Contributor

    Ah yes, although the update with this change is live in our default docker image (mcr.microsoft.com/vscode/devcontainers/universal:1), we haven't updated our cached version in codespaces yet (we do this caching to get people into codespaces fast).

    If you run a Rebuild (Codespaces: Rebuild Container) from the vscode command palette after creating your codespace, it will pull the latest image (ignoring our cache), and you should have the latest changes we're discussing above.


    That said, it looks like when oryx is analyzing your project, its deciding to install version 11.0.8 of java

    (from the creation.log)

    2022-01-24T16:40:24: Oryx Version: 0.2.20220120.1, Commit: 9b4b24ca97b5e87c9b8fcb65ef7adb88c6f709e6, ReleaseTagName: 20220120.1
    2022-01-24T16:40:24: 
    2022-01-24T16:40:24: Build Operation ID: |BsTM32dNplc=.cbb8fe68_
    2022-01-24T16:40:24: Repository Commit : 3ddbe548d95954f830cd824dbf71dbd3d5b4d0e5
    2022-01-24T16:40:24: 
    2022-01-24T16:40:24: Detecting platforms...
    2022-01-24T16:40:24: Detected following platforms:
    2022-01-24T16:40:25:   java: 11.0.8
    2022-01-24T16:40:25: Version '11.0.8' of platform 'java' is not installed. Generating script to install it...
    2022-01-24T16:40:25: 
    2022-01-24T16:40:25: 
    2022-01-24T16:40:25: Source directory     : /workspaces/jmolecules-integrations
    2022-01-24T16:40:25: Destination directory: /workspaces/jmolecules-integrations
    2022-01-24T16:40:25: 
    2022-01-24T16:40:25: 
    2022-01-24T16:40:25: Downloading and extracting 'java' version '11.0.8' to '/opt/java/11.0.8'...
    

    image

  12. joshspicer commented on Jan 24, 2022

    @joshspicer
    Contributor

    doing a rebuild on a non-java project (forcing an invalidation of our cached mcr.microsoft.com/vscode/devcontainers/universal), leaves us with the default version of java that we expected

    image

  13. joshspicer commented on Jan 24, 2022

    @joshspicer
    Contributor

    Dave Syer (@dsyer) - please feel free to reopen if what i'm showing here doesn't match what you expect :)

    We should be updating our cache of the docker image in the next day or so, and starting then new codespace creations will look the same as a create->rebuild (like I mentioned above).

  14. dsyer commented on Jan 24, 2022

    @dsyer
    Author

    Works for me now, thanks.

  15. joshspicer commented on Jan 24, 2022

    @joshspicer
    Contributor

    thank you for letting us know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcodespaces

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions