类文件无法被引用,且显示为java文件处理方案

IDEA提示:The file size (3.48MB) exceeds configured limit (244 MB). Code insight features are not available.

错误表现:

1.某个java类确定存在项目中,却在引用处提示找不到该类
2.对应的类文件中提示
the file size(3.40M) exceeds configured limit(2.56M).Code insight features are not available
3.对应的文件显示为 **.java文件,没有显示该文件是一个Class文件

原因:

该文件超过IDEA感知的最大文件大小

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE should provide code assistance for.
# The larger file is the slower its editor works and higher overall system memory requirements are
# if code assistance is enabled. Remove this property or set to very large number if you need
# code assistance for any files available regardless their size.
#---------------------------------------------------------------------
idea.max.intellisense.filesize=2500
解决方案:

1.修改IDEA配置文件中的配置文件,重启后生效

路径:…\IntelliJ IDEA \bin\idea.properties

修改内容:idea.max.intellisense.filesize

2.在IDEA开发页面,点击help→Edit Custom Properties,会在…\IntelliJIdea2018.2\config目录下创建idea.properties文件,文件内容中设置idea.max.intellisense.filesize

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
可以使用 Apache POI 库来将 Java List 对象转换为 Excel 文件。以下是一个示例代码: ```java import java.io.FileOutputStream; import java.io.IOException; import java.util.List; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class ListToExcelConverter { public void convert(List<Object[]> data, String filePath) throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); org.apache.poi.ss.usermodel.Sheet sheet = workbook.createSheet("Sheet1"); int rowNum = 0; for (Object[] rowData : data) { Row row = sheet.createRow(rowNum++); int colNum = 0; for (Object field : rowData) { Cell cell = row.createCell(colNum++); if (field instanceof String) { cell.setCellValue((String) field); } else if (field instanceof Integer) { cell.setCellValue((Integer) field); } else if (field instanceof Double) { cell.setCellValue((Double) field); } else if (field instanceof Boolean) { cell.setCellValue((Boolean) field); } } } try (FileOutputStream outputStream = new FileOutputStream(filePath)) { workbook.write(outputStream); } } } ``` 在上面的代码中,我们使用 `XSSFWorkbook` 来创建一个新的 Excel 工作簿,然后创建一个名称为 "Sheet1" 的工作表。接着,我们遍历 Java List 对象中的数据,将它们添加到 Excel 表格中。最后,我们将 Excel 文件保存到指定的文件路径中。 你可以使用以下代码将 Java List 对象转换为 Excel 文件: ```java List<Object[]> data = ... // 获取你要转换的数据 String filePath = "data.xlsx"; // 指定保存的文件路径 ListToExcelConverter converter = new ListToExcelConverter(); converter.convert(data, filePath); ``` 注意,上面的代码仅适用于 Excel 2007 或更高版本的 ".xlsx" 文件。如果你需要处理早期版本的 Excel 文件(例如 ".xls" 文件),则需要使用 HSSF API,而不是 XSSF API。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值