当前位置:网站首页>Get the absolute path of the class according to the bytecode
Get the absolute path of the class according to the bytecode
2022-04-23 08:35:00 【Silence, your name】
Applicable to current module or incoming module .
Not applicable to third parties jar package
/**
* Get the absolute path of the class according to the bytecode
*
* @param clazz clazz
* @return classRealPath
*/
private static String getClassRealPath(Class<?> clazz) {
String classPath = clazz.getName().replace(".", "/") + ".class";
String classRealPath = Objects.requireNonNull(clazz.getResource("/" + classPath)).getPath();
classRealPath = classRealPath.replace("target/classes", "src/main/java");
classRealPath = classRealPath.replace(".class", ".java");
classRealPath = StrUtil.replace(classRealPath, "/", "\\");
return classRealPath.substring(1);
}
版权声明
本文为[Silence, your name]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230810200236.html
边栏推荐
- 洋桃电子STM32物联网入门30步笔记一、HAL库和标准库的区别
- Ansible Automation Operation and Maintenance details (ⅰ) Installation and Deployment, Parameter use, list Management, Profile Parameters and user level ansible operating environment Construction
- Queue (C language / linked list)
- DOM学习笔记---遍历页面所有元素节点
- ATSS(CVPR2020)
- [learning] audio and video development from scratch (9) -- nuplayer
- SYS_ CONNECT_ BY_ Path (column, 'char') combined with start with connect by prior
- 数据可视化:使用Excel制作雷达图
- Description of the abnormity that the key frame is getting closer and closer in the operation of orb slam
- Search the complete navigation program source code
猜你喜欢
随机推荐
Stm32f103zet6 [development of standard library functions] - Introduction to library functions
RCC introduction of Hal Library
idea底栏打开services
form表单 post提交 数据量大的问题
synchronized 锁的基本用法
【深度好文】Flink SQL流批⼀体化技术详解(一)
Asan minimalism
CGM optimizes blood glucose monitoring and management -- Yiyu technology appears in Sichuan International Medical Exchange Promotion Association
什么是RPC
5.6 comprehensive case - RTU-
关于cin,scanf和getline,getchar,cin.getline的混合使用
匿名类型(C# 指南 基础知识)
项目上传部分
Queue (C language / linked list)
Word plus watermark
JS中复制数组
Copy array in JS
Type anonyme (Principes fondamentaux du Guide c)
Failed to convert a NumPy array to a Tensor(Unsupported Object type int)
Description of the abnormity that the key frame is getting closer and closer in the operation of orb slam