V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Cbdy
V2EX  ›  Java

今天遇到一个超级古怪的“Bug”

  •  
  •   Cbdy · 2018-07-24 15:14:38 +08:00 · 3937 次点击
    这是一个创建于 2320 天前的主题,其中的信息可能已经有所发展或是发生改变。

    事情的经过是这样,我建立了一个含有多个子模块的 Maven 工程 a,为其中一个 Spring Boot 子模块引入了 Lombok 来生成字节码,然后我发现,如果把 a 放到一个含有汉字“一”的文件夹,使用 IDEA 运行 Spring Boot 子模块会报一个 Java 编译错误。上述任何条件不满足,这个问题就不会复现,满足则稳定复现。

    报错信息

    Information:java: 编译器 (10.0.2) 中出现异常错误。如果在 Bug Database ( http://bugs.java.com) 中没有找到该错误, 请通过 Java Bug 报告页 ( http://bugreport.java.com) 建立该 Java 编译器 Bug。请在报告中附上您的程序和以下诊断信息。谢谢。
    Information:java: java.lang.IllegalArgumentException: directories not supported
    Information:java: 	at jdk.compiler/com.sun.tools.javac.file.PathFileObject.<init>(PathFileObject.java:353)
    Information:java: 	at lombok.javac.apt.Javac9BaseFileObjectWrapper.<init>(Javac9BaseFileObjectWrapper.java:42)
    Information:java: 	at lombok.javac.apt.LombokFileObjects$Java9Compiler.wrap(LombokFileObjects.java:172)
    Information:java: 	at lombok.javac.apt.LombokFileObjects.createIntercepting(LombokFileObjects.java:161)
    Information:java: 	at lombok.javac.apt.InterceptingJavaFileManager.getJavaFileForOutput(InterceptingJavaFileManager.java:53)
    Information:java: 	at jdk.compiler/com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:1677)
    Information:java: 	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:749)
    Information:java: 	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1627)
    Information:java: 	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1595)
    Information:java: 	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:965)
    Information:java: 	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100)
    Information:java: 	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
    Information:java: 	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
    Information:java: 	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
    Information:java: 	at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:198)
    Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:453)
    Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:317)
    Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:244)
    Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:202)
    Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1314)
    Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:991)
    Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1063)
    Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:954)
    Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:787)
    Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:376)
    Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:183)
    Information:java: 	at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
    Information:java: 	at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:308)
    Information:java: 	at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:137)
    Information:java: 	at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:235)
    Information:java: 	at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
    Information:java: 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
    Information:java: 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    Information:java: 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
    Information:java: 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    Information:java: 	at java.base/java.lang.Thread.run(Thread.java:844)
    Information:java: Errors occurred while compiling module 'a'
    Information:javac 10.0.2 was used to compile java sources
    Information:2018/7/24 下午 3:11 - Compilation completed with 1 error and 0 warnings in 10 s 112 ms
    Error:java: Compilation failed: internal java compiler error
    

    系统环境

    • Java
    java 10.0.2 2018-07-17
    Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
    Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
    
    • IntelliJ IDEA
    IntelliJ IDEA 2018.1.6 (Ultimate Edition)
    Build #IU-181.5540.7, built on July 11, 2018
    JRE: 1.8.0_152-release-1136-b39 x86_64
    JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
    macOS 10.13.6
    ```
    
    2 条回复    2018-08-01 14:32:51 +08:00
    stephCurry
        1
    stephCurry  
       2018-08-01 13:32:24 +08:00
    异常信息不是很明显了吗, 非法参数异常, 文件夹不支持, 文件夹中文名的问题啊
    Cbdy
        2
    Cbdy  
    OP
       2018-08-01 14:32:51 +08:00
    @stephCurry 只有当文件夹名字中含有汉字“一”才不支持,“二”或者其他就都支持
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1656 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 16:48 · PVG 00:48 · LAX 08:48 · JFK 11:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.