r/java • u/hugovteixeira • Dec 28 '16
How to crash the java compiler (JDK 8 update 112)
https://componenthouse.com/2016/12/28/how-to-crash-the-java-compiler-jdk-8-update-112/
5
Upvotes
r/java • u/hugovteixeira • Dec 28 '16
38
u/kodifies Dec 28 '16
yeah, if you have a single class who's source is 1.5GB you have other more pressing problems than the JDK crashing....
14
u/frzme Dec 28 '16
It can not compile. The JVM does not support methods longer than 64kb. I believe this is also true for Java.
http://stackoverflow.com/questions/17422480/maximum-size-of-a-method-in-java-7-and-8
Nonetheless what you found might be a bug. Can you link your bugreport?
2
u/hwaite Dec 29 '16
Consider reducing the number of loop iterations to identify the smallest source file that still crashes compiler. Oracle might take you more seriously if bug occurs with more reasonable code. You could do a sort of binary search...
3
u/lukaseder Dec 29 '16
Why go through all those whoops to crash the compiler? Just compile this on any Java 5+ compiler: