Skip to content

[Help] is there a way to install metals on vscode in centos7 offline? #1617

@facebreeze

Description

@facebreeze

Hi,
I need to run sbt built scala project in CentOS7 without internet connection, and I have successfully installed Vscode extension scala(Metals) with vsix file. After setup environment variable JAVA_HOME, the metals still can not start with following error:

OUTPUT.Metals

Metals version: 1.5.1
Fetching coursier
	% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
	                                 Dload  Upload   Total   Spent    Left  Speed
	
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
	0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
	0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
	curl: (6) Could not resolve host: github.com; Unknown error
	gzip: stdin: unexpected end of file
Failed to fetch coursier. You may want to try installing coursier manually and adding it to PATH.
Will try to use jar based coursier if Java is available on the machine.
Using coursier located at undefined
Checking Java in JAVA_HOME, which points to /workspace/xxx/tools/jvm/jdk-17.0.12
	java version "17.0.12" 2024-07-16 LTS
	Java(TM) SE Runtime Environment (build 17.0.12+8-LTS-286)
	Java HotSpot(TM) 64-Bit Server VM (build 17.0.12+8-LTS-286, mixed mode, sharing)
Using Java Home: /workspace/xxx/tools/jvm/jdk-17.0.12
Error while downloading https://repo1.maven.org/maven2/com/chuusai/shapeless_2.12/2.3.3/shapeless_2.12-2.3.3.jar: /workspace/xxx/COURSIER_HOME/.structure.lock (Permission denied), ignoring it
Downloading Metals failed with the following:
Process exited with code 255
  Metals version: 1.5.1  
  Server properties: -Xmx2G,-XX:+UseZGC,-XX:ZUncommitDelay=30,-XX:ZCollectionInterval=5,-XX:+IgnoreUnrecognizedVMOptions 
  Java configuration: 
    - coursier: /workspace/xxx/vscode_extensions/extensions/scalameta.metals-1.47.0/coursier-fallback.jar
    - coursier mirror: undefined
    - extra environment: [object Object]
    - java options: 
    - java path: /workspace/xxx/jvm/jdk-17.0.12/bin/java
    
Error, couldn't show release notes for Metals 1.5.1
Error: getaddrinfo ENOTFOUND api.github.com

OUTPUT.Extension Host:

2025-03-21 16:38:02.438 [info] Extension host with pid 62043 started
2025-03-21 16:38:02.438 [info] Skipping acquiring lock for /workspace/xxx/tools/VSCode-linux-x64-1.85/data/user-data/User/workspaceStorage/0487b1f6a393fcfebdba2604bf30bcd1.
2025-03-21 16:38:02.666 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
2025-03-21 16:38:02.682 [info] ExtensionService#_doActivateExtension vscode.json-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
2025-03-21 16:38:02.730 [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
2025-03-21 16:38:03.497 [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.git
2025-03-21 16:38:03.504 [info] ExtensionService#_doActivateExtension mjcrouch.perforce, startup: true, activationEvent: '*'
2025-03-21 16:38:03.562 [info] ExtensionService#_doActivateExtension scalameta.metals, startup: true, activationEvent: 'workspaceContains:build.sbt'
2025-03-21 16:38:06.761 [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*'
2025-03-21 16:38:06.805 [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
2025-03-21 16:38:11.630 [error] Error: Coursier exit: 255
	at ChildProcess.<anonymous> (/workspace/xxx/vscode_extensions/extensions/scalameta.metals-1.47.0/node_modules/metals-languageclient/lib/downloadProgress.js:24:19)
	at ChildProcess.emit (node:events:525:35)
	at maybeClose (node:internal/child_process:1091:16)
	at ChildProcess._handle.onexit (node:internal/child_process:302:5)
2025-03-21 16:38:13.431 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2025-03-21 16:38:13.438 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
2025-03-21 16:38:13.456 [info] ExtensionService#_doActivateExtension monokai.theme-monokai-pro-vscode, startup: false, activationEvent: 'onStartupFinished'
2025-03-21 16:38:13.472 [info] ExtensionService#_doActivateExtension mshr-h.veriloghdl, startup: false, activationEvent: 'onStartupFinished'
2025-03-21 16:38:14.785 [info] ExtensionService#_doActivateExtension ScooterSoftware.bcompare-vscode, startup: false, activationEvent: 'onStartupFinished'
2025-03-21 16:38:14.857 [info] ExtensionService#_doActivateExtension vscodevim.vim, startup: false, activationEvent: 'onStartupFinished'
2025-03-21 16:38:15.055 [info] Eager extensions activated

Need help !!!

vscode version:

Version: 1.85.2
Commit: 8b3775030ed1a69b13e4f4c628c612102e30a681
Date: 2024-01-18T06:40:19.222Z
Electron: 25.9.7
ElectronBuildId: 26354273
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 5.4.258-1.el7.elrepo.x86_64

Scala Metals:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions