Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 8 compiler error - how to get more information?

I played around with Java 8 ea b72, but I get a compiler error. Is there a way to get more information from javac, e.g. the file list it is currently working on? If I had a general idea where to look I might be able to find a work-around until the issue is fixed.

Just for the record, here is the stack-trace (it looks similar if compiled outside of IntelliJ IDEA, BTW):

An exception has occurred in the compiler (1.8.0-ea). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.AssertionError: arraycode A
    at com.sun.tools.javac.jvm.Code.arraycode(Code.java:297)
    at com.sun.tools.javac.jvm.Gen.makeNewArray(Gen.java:1827)
    at com.sun.tools.javac.jvm.Gen.visitNewArray(Gen.java:1800)
    at com.sun.tools.javac.tree.JCTree$JCNewArray.accept(JCTree.java:1482)
    at com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:893)
    at com.sun.tools.javac.jvm.Gen.genArgs(Gen.java:912)
    at com.sun.tools.javac.jvm.Gen.visitApply(Gen.java:1746)
    at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1391)
    at com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:893)
    at com.sun.tools.javac.jvm.Gen.visitReturn(Gen.java:1715)
    at com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1310)
    at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:683)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:718)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:704)
    at com.sun.tools.javac.jvm.Gen.genStats(Gen.java:755)
    at com.sun.tools.javac.jvm.Gen.visitBlock(Gen.java:1090)
    at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:835)
    at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:683)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:718)
    at com.sun.tools.javac.jvm.Gen.genMethod(Gen.java:968)
    at com.sun.tools.javac.jvm.Gen.visitMethodDef(Gen.java:941)
    at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:723)
    at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:683)
    at com.sun.tools.javac.jvm.Gen.genClass(Gen.java:2310)
    at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:751)
    at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1545)
    at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1509)
    at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:907)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:866)
    at com.sun.tools.javac.main.Main.compile(Main.java:506)
    at com.sun.tools.javac.main.Main.compile(Main.java:365)
    at com.sun.tools.javac.main.Main.compile(Main.java:354)
    at com.sun.tools.javac.main.Main.compile(Main.java:345)
    at com.sun.tools.javac.Main.compile(Main.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:477)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess0(JavacCompiler.java:551)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:526)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:167)
    at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:678)
    at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:477)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:477)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)


    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:477)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:477)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
like image 245
Landei Avatar asked Jan 15 '13 22:01

Landei


People also ask

How do I fix compile errors in Java?

If the brackets don't all match up, the result is a compile time error. The fix to this compile error is to add a leading round bracket after the println to make the error go away: int x = 10; System.

Why am I getting a compiler error?

A compile error happens when the compiler reports something wrong with your program, and does not produce a machine-language translation. You will get compile errors.

Why is my Java program not compiling?

It means that javac.exe executable file, which exists in bin directory of JDK installation folder is not added to PATH environment variable. You need to add JAVA_HOME/bin folder in your machine's PATH to solve this error. You cannot compile and run Java program until your add Java into your system's PATH variable.

Which line would cause a compiler error in Java?

An example of a syntax error is if the code has a open curly brace { , but no close curly brace } . The error messages will tell the line number that the compiler found the error and the type of error.


1 Answers

This is a bit of a last-resort, but you could try using strace to monitor what files javac is opening. strace [your javac invocation] | grep '/directory/you/are/interested/in/ might give you some clues.

like image 138
jacobm Avatar answered Sep 25 '22 18:09

jacobm