添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
刚毅的长颈鹿  ·  Spring boot ...·  2 年前    · 

Gradle using Java 8 - Any gradle build script error returns as a StreamCorruptedException with no useful content instead of the actual gradle exception #1594

Closed
@jakegt1

Description

@jakegt1

When using Gradle with java.configuration.runtimes set to a JavaSE-1.8 JVM, any problems in a build.gradle script will come up with a java.io.StreamCorruptedException instead of the actual exception.

This can be very painful to debug, because it might happen that when executing gradle manually via command line, you might find that the build itself will go through with one of the default targets, but if one of the sub projects is executed it will throw an error.

Environment
  • Operating System: Centos 7
  • JDK version: 1.8.0b252
  • Visual Studio Code version: 1.48.1
  • Java extension version: 0.65.0
  • Steps To Reproduce
  • Write a gradle script with any sort of gradle parsing error
  • See problems menu that only describes the error as
  • java.io.StreamCorruptedException: invalid type code: 00
    invalid type code: 00
    

    Example script:

    this is just random text in a build.gradle
    Current Result

    Returns blank exception

    Expected Result
  • What went wrong:
    Could not compile build file 'build.gradle'.
  • startup failed:
    build file 'build.gradle': 1: unexpected token: in @ line 1, column 26.
    this is just random text in a build.gradle

    Additional Informations