Gradle using Java 8 - Any gradle build script error returns as a StreamCorruptedException with no useful content instead of the actual gradle exception
See original GitHub issueWhen 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (5 by maintainers)
Top Results From Across the Web
Building with gradle fails log shows java.io ...
properties file and IJ log shows "java.io.StreamCorruptedException: invalid type code: 00" indicating some kind of JVM mismatch. Using the ...
Read more >Gradle error: could not execute build using gradle distribution
I had the same issue, can't say I know what caused it, but I just closed Android Studio, renamed the c:\users\MY USERNAME\.gradle directory ......
Read more >Gradle reports java.io.StreamCorruptedException and freezes ...
I am getting the dreaded java.io.StreamCorruptedException when running Gradle tests. I understand that this happens if you System.exit() in your tests but ...
Read more >Consolidated JDK 8 Release Notes - Oracle
This page contains all of the release notes for General Availability (GA) releases and Bundled Patch Release (BPR) builds of JDK 8.
Read more >How to Fix java.io.StreamCorruptedException: invalid type ...
StreamCorruptedException : invalid type code in Java? ... using serialization, writing the file will be done successfully without any error.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I can’t reproduce the issue. @fbricon @jakegt1 Could you attach a project example?
@CsCherrYY Can verify this now works - Thanks!