Nextflow language server errors

I’m using the nextflow plugin within VS Code, but the language server fails to start. It seems to be a version compatibility issue, but I’m too much of a Java newb to figure it out. Do I just need to get my hands on a newer Java version?

Below are the error logs.

Error: LinkageError occurred while loading main class nextflow.lsp.NextflowLanguageServer
	java.lang.UnsupportedClassVersionError: nextflow/lsp/NextflowLanguageServer has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
[Error - 11:18:36 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 11:18:36 AM] Connection to server got closed. Server will restart.
true
[Error - 11:18:36 AM] Nextflow Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
Error: LinkageError occurred while loading main class nextflow.lsp.NextflowLanguageServer
	java.lang.UnsupportedClassVersionError: nextflow/lsp/NextflowLanguageServer has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
[Error - 11:18:36 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 11:18:36 AM] Connection to server got closed. Server will restart.
true
[Error - 11:18:36 AM] Nextflow Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
Error: LinkageError occurred while loading main class nextflow.lsp.NextflowLanguageServer
	java.lang.UnsupportedClassVersionError: nextflow/lsp/NextflowLanguageServer has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
[Error - 11:18:36 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 11:18:36 AM] Connection to server got closed. Server will restart.
true
[Error - 11:18:36 AM] Nextflow Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:18:36 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
Error: LinkageError occurred while loading main class nextflow.lsp.NextflowLanguageServer
	java.lang.UnsupportedClassVersionError: nextflow/lsp/NextflowLanguageServer has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
[Error - 11:18:36 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 11:18:36 AM] Connection to server got closed. Server will restart.
true
[Error - 11:18:36 AM] Nextflow Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:18:36 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
Error: LinkageError occurred while loading main class nextflow.lsp.NextflowLanguageServer
	java.lang.UnsupportedClassVersionError: nextflow/lsp/NextflowLanguageServer has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
[Error - 11:18:37 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:18:37 AM] The Nextflow Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 11:18:37 AM] Nextflow Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:18:37 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 

1 Like

Yes you need Java 17 or later

2 Likes

I do seem to have 17, but I can try to get something newer anyway.

openjdk 17.0.13-internal 2024-10-15
OpenJDK Runtime Environment (build 17.0.13-internal+0-adhoc..src)
OpenJDK 64-Bit Server VM (build 17.0.13-internal+0-adhoc..src, mixed mode, sharing)

I now installed version 21 and the errors have gone away.

openjdk 21.0.4 2024-07-16
OpenJDK Runtime Environment (build 21.0.4+7-Ubuntu-1ubuntu220.04)
OpenJDK 64-Bit Server VM (build 21.0.4+7-Ubuntu-1ubuntu220.04, mixed mode, sharing)

Not sure why it’s failing then. How is your Java installed? I always install it with sdkman.

There is also an extension setting to set the Java home, maybe you have multiple Java installations and the extension is picking the wrong one

I had openjdk-17 installed from the Ubuntu/Debian packages and it was the only version then. It was definitely the selected java version. I’m still running Ubuntu 20.04 at the moment, so I don’t know if that introduces other problems.

That’s strange, I don’t know why this error would happen even with Java 17, since the language server is targeting Java 17 bytecode. I’m glad you found a solution for now at least, using Java 21 should be fine.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.