Error:(10, 14) java: 类重复: com.xx.R解决方法

本文介绍了解决项目部署过程中遇到的类文件未被编译的问题,主要原因是src目录未正确设置为Source,以及错误地将整个工程设为Source导致的类文件重复。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天部署一个项目搞了半天 , 开始是所有的类报红色感叹号,后边是报gen下面的文件类重复,原因都在于配置的Source目录不对。如下图


蓝色部分表示打包时包含在Source内, 下面是遇到的两个问题

 1. src目录未选成Sources导致所有类文件未被编译到生成的包内。

  2. 错误的把整个工程选中Sources,导致 R文件及gen下的其他文件出现类重复。

# # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000002198f97ba40, pid=17124, tid=18936 # # JRE version: OpenJDK Runtime Environment JBR-21.0.5+8-631.30-jcef (21.0.5+8) (build 21.0.5+8-b631.30) # Java VM: OpenJDK 64-Bit Server VM JBR-21.0.5+8-631.30-jcef (21.0.5+8-b631.30, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) # Problematic frame: # j io.netty.channel.nio.NioIoHandler.select(Lio/netty/channel/IoExecutionContext;Z)V+99 # # No core dump will be written. Minidumps are not enabled by default on client versions of Windows # # If you would like to submit a bug report, please visit: # https://youtrack.jetbrains.com/issues/JBR # --------------- S U M M A R Y ------------ Command Line: abort vfprintf -XX:ErrorFile=C:\Users\27663\java_error_in_pycharm_%p.log -XX:HeapDumpPath=C:\Users\27663\java_error_in_pycharm.hprof -Xms256m -Xmx2048m -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -XX:CICompilerCount=2 -XX:+IgnoreUnrecognizedVMOptions -ea -Dsun.io.useCanonCaches=false -Dsun.java2d.metal=true -Djbr.catch.SIGABRT=true -Djdk.http.auth.tunneling.disabledSchemes="" -Djdk.attach.allowAttachSelf=true -Djdk.module.illegalAccess.silent=true -Djdk.nio.maxCachedBufferSize=2097152 -Djava.util.zip.use.nio.for.zip.file.access=true -Dkotlinx.coroutines.debug=off -XX:+UnlockDiagnosticVMOptions -XX:TieredOldPercentage=100000 -Dwelcome.screen.defaultWidth=1000 -Dwelcome.screen.defaultHeight=720 -Dwsl.use.remote.agent.for.nio.filesystem=true -Djava.nio.file.spi.DefaultFileSystemProvider=com.intellij.platform.core.nio.fs.MultiRoutingFileSystemProvider -Djava.security.manager=com.intellij.platform.core.nio.fs.CoreBootstrapSecurityManager --add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED -javaagent:C:\Users\27663\AppData\Roaming\PyCharm\
03-18
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值