Intellij IDEA run shell base on BashSupport plugin

本文介绍在IntelliJ IDEA中使用BaseSupport插件运行shell脚本遇到中文乱码问题的解决方案。通过调整run configuration中的环境变量来添加UTF-8语言支持,最终成功解决了中文注释的乱码问题。

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

在Intellij IDEA中,通过插件BaseSupport允许shell脚本时候,发现中文处理的并不是很好。

 

shell脚本内容:

#!/bin/sh

java -jar ./mybatis-generator-core_libs/mybatis_generator.jar  -configfile ./db/resources/userdata/account.xml  -overwrite

 (PS:本来是想通过mybatis插件直接在IDEA中操作的,但是死活找不到相应的mybatis generator右键菜单,知道的朋友麻烦告知一下。谢谢。)

 

生成的Bean文件:(其中的乱码是中文注释)

 

猜测可能是语言的问题,修改run configuration

1,打开configuration窗口



 

 

编辑 Environment variables,添加utf-8语言支持



 

Apply生效。

 

重新run一次。

 

结果如下:



 

 

[ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for JEECG BOOT 3.7.3 3.7.3: [INFO] [INFO] JEECG BOOT 3.7.3 ................................... SUCCESS [ 5.688 s] [INFO] jeecg-boot-base-core ............................... FAILURE [03:04 min] [INFO] jeecg-module-demo .................................. SKIPPED [INFO] jeecg-module-system ................................ SKIPPED [INFO] jeecg-system-api ................................... SKIPPED [INFO] jeecg-system-local-api ............................. SKIPPED [INFO] jeecg-system-cloud-api ............................. SKIPPED [INFO] jeecg-system-biz ................................... SKIPPED [INFO] jeecg-system-start ................................. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 03:25 min [INFO] Finished at: 2025-03-11T19:53:35+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project jeecg-boot-base-core: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [ERROR] [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki
03-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值