IntelliJ IDEA 10.0 使用javac 编译程序出现“非法字符

本文详细介绍了在IntelliJ IDEA 10.0中使用UTF-8编码时出现非法字符65279的解决办法。主要原因是IDEA在保存文件时自动添加了UTF-8的BOM签名。提供了两种解决方案:一是通过设置使用Eclipse编译器,二是使用EditPlus去除BOM。

IntelliJ IDEA 10.0  使用javac 编译程序出现“非法字符:  \65279 ”解决方法

 

一、问题描述:

将在eclipse 创建的项目代码导入 IntelliJ IDEA 10.0 后发现中文乱码,使用工具将源文件编码统一转为“ UTF-8”后,显示正常,但在修改文件后,编译出现“ 非法字符: \65279 ”。

二、产生原因:

IntelliJ IDEA 10.0 对设置为“ UTF-8 ”编码的文件在修改后保存时自动加入了 UTF-8文件签名,即 BOM (将文件以十六进制形式查看,可见文件首部为“ EF BB BF ”) .

三、解决方法:

(1) 使用Eclipse 编译器进行编译,在 IntelliJ IDEA 10.0 中设置的方法为 Settings ( Ctrl+Alt+S ) ->Project Setting->Compiler->Java Complier->Use complier选择 Eclipse ,点击 OK

(2) 使用EditPlus 去除 BOM ( EditPlus 版本为 3.01 )

具体方法:先设置去除UTF-8 的文件签名,然后打开文件,另存为 UTF-8 即可

设置方法:工具-> 首选项 -> 文件 -> 默认编码方式: UFT-8 , UTF-8 标识:总是删除签名。


出处:http://shendixiong.iteye.com/blog/1178070

转载于:https://my.oschina.net/kevinky/blog/713638

# # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000000000004e, pid=36860, tid=20036 # # JRE version: OpenJDK Runtime Environment JBR-11.0.11.9-1504.13-jcef (11.0.11+9) (build 11.0.11+9-b1504.13) # Java VM: OpenJDK 64-Bit Server VM JBR-11.0.11.9-1504.13-jcef (11.0.11+9-b1504.13, mixed mode, tiered, compressed oops, g1 gc, windows-amd64) # Problematic frame: # C 0x000000000000004e # # 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://bugreport.java.com/bugreport/crash.jsp # --------------- S U M M A R Y ------------ Command Line: exit -Xmx8192m -XX:ReservedCodeCacheSize=512m -Xms128m -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:CICompilerCount=2 -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -ea -Dsun.io.useCanonCaches=false -Djdk.http.auth.tunneling.disabledSchemes="" -Djdk.attach.allowAttachSelf=true -Djdk.module.illegalAccess.silent=true -Dkotlinx.coroutines.debug=off -Dsplash=true -javaagent:E:\\idea-2021\\FineAgent\\FineAgent.jar -Djb.vmOptionsFile=C:\Users\dell\AppData\Roaming\JetBrains\IntelliJIdea2021.2\idea64.exe.vmoptions -Djava.system.class.loader=com.intellij.util.lang.PathClassLoader -Didea.vendor.name=JetBrains -Didea.paths.selector=IntelliJIdea2021.2 -Didea.jre.check=true -Dide.native.launcher=true -XX:ErrorFile=C:\Users\dell\java_error_in_idea64_%p.log -XX:HeapDumpPath=C:\Users\dell\java_error_in_idea64.hprof Host: 12th Gen Intel(R) Core(TM) i5-12500T, 12 cores, 31G, Windows 10 , 64 bit Build 19041 (10.0.19041.5915) Time: Mon Sep 8 13:38:33 2025 中国标准时间 elapsed time: 17792.851945 seconds (0d 4h 56m 32s) --------------- T H R E A D --------------- Current thread (0x0000000119900800): JavaThread "JobScheduler FJ pool 12/11" daemon [_thread_in_Java, id=20036, stack(0x00000000de490000,0x00000000de590000)] Stack: [0x00000000de490000,0x00000000de590000], sp=0x00000000de58b3d8, free space=1004k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C 0x000000000000004e siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), data execution prevention violation at address 0x000000000000004e Register to memory mapping: RIP=0x000000000000004e is an unknown value RAX=0x00000008017a2b90 is a pointer to class: com.intellij.psi.javadoc.PsiDocComment {0x00000008017a2b98} RBX=0x0000000639bab5f8 is an oop: com.intellij.psi.impl.source.PsiParameterImpl {0x0000000639bab5f8} - klass: 'com/intellij/psi/impl/source/PsiParameterImpl' RCX=0x0 is NULL RDX=0x000015bbc50e0dc7 is an unknown value RSP=0x00000000de58b3d8 is pointing into the stack for thread: 0x0000000119900800 RBP=0x000000060cea4310 is an oop: [Lcom.intellij.psi.PsiClass; {0x000000060cea4310} - klass: 'com/intellij/psi/PsiClass'[] - length: 0 RSI=0x00000008017fe340 is a pointer to class: com.intellij.psi.impl.source.PsiParameterImpl {0x00000008017fe348} RDI=3892612528 is a compressed pointer to object: [error occurred during error reporting (printing register info), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffe5ae7296d] Registers: RAX=0x00000008017a2b90, RBX=0x0000000639bab5f8, RCX=0x0000000000000000, RDX=0x000015bbc50e0dc7 RSP=0x00000000de58b3d8, RBP=0x000000060cea4310, RSI=0x00000008017fe340, RDI=0x00000000e8048db0 R8 =0x00000008017a2b90, R9 =0x000000007ffe1000, R10=0x0000000639bab5f8, R11=0x0000000800b3d7a0 R12=0x0000000000000000, R13=0x00000000c0bdc6bf, R14=0x0000000605ee35f8, R15=0x0000000119900800 RIP=0x000000000000004e, EFLAGS=0x0000000000010206 Top of Stack: (sp=0x00000000de58b3d8) 0x00000000de58b3d8: 00000008017a2b90 000000000000000a 0x00000000de58b3e8: 0000000019ba33a4 0000000677ffd978 0x00000000de58b3f8: 000000001cea9c04 0178dfd0028d5eb8 0x00000000de58b408: 000000074b9a2300 0000000617050120 0x00000000de58b418: 00000006435cead0 0000000802b10840 0x00000000de58b428: 0000000616b5a0b0 0000000609dc52b8 0x00000000de58b438: 0000000630a4d290 000000067af38668 0x00000000de58b448: 000000060cea4310 0000000802ab8440 0x00000000de58b458: 00000008004fcc40 0000000801ec6cf0 0x00000000de58b468: 0000000800310440 00000008028fb840 0x00000000de58b478: 000000080077f440 0000000800769900 0x00000000de58b488: 0000000800154e70 00000008000457f0 0x00000000de58b498: 0000000628e37888 000000060ce73a10 0x00000000de58b4a8: 0000000018ac1ee8 000000061428ff28 0x00000000de58b4b8: 0000000025260000 00000000ffffffc3 0x00000000de58b4c8: 000000074b99f0e8 0000000609dc52b8 Instructions: (pc=0x000000000000004e) 0xffffffffffffff4e: Stack slot to memory mapping: stack at sp + 0 slots: 0x00000008017a2b90 is a pointer to class: com.intellij.psi.javadoc.PsiDocComment {0x00000008017a2b98} stack at sp + 1 slots: 0x000000000000000a is an unknown value stack at sp + 2 slots: 0x0000000019ba33a4 is at entry_point+292 in (nmethod*)0x0000000019ba3010 stack at sp + 3 slots: 0x0000000677ffd978 is an oop: com.intellij.util.CachedValueBase$Data {0x0000000677ffd978} - klass: 'com/intellij/util/CachedValueBase$Data' stack at sp + 4 slots: 0x000000001cea9c04 is at entry_point+772 in (nmethod*)0x000000001cea9690 stack at sp + 5 slots: 0x0178dfd0028d5eb8 is an unknown value stack at sp + 6 slots: 0x000000074b9a2300 is an oop: com.intellij.psi.impl.source.PsiJavaFileBaseImpl$1 {0x000000074b9a2300} - klass: 'com/intellij/psi/impl/source/PsiJavaFileBaseImpl$1' stack at sp + 7 slots: 0x0000000617050120 is an oop: com.intellij.psi.ResolveState {0x0000000617050120} - klass: 'com/intellij/psi/ResolveState' com.intellij.diagnostic.JBRCrash
最新发布
09-09
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值