当前位置:网站首页>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
边栏推荐
- pdf加水印
- Redis Desktop Manager for Mac(Redis可视化工具)
- 数据可视化:使用Excel制作雷达图
- JSP page coding
- tsdf +mvs
- '恶霸' Oracle 又放大招,各大企业连夜删除 JDK。。。
- Detailed explanation of ansible automatic operation and maintenance (I) installation and deployment, parameter use, list management, configuration file parameters and user level ansible operating envi
- One click cleanup of pycharm and jupyter cache files under the project
- 耳穴减肥自身感受细节描述0422
- jsp页面编码
猜你喜欢
There are some problems when using numeric type to query string type fields in MySQL
程序,进程,线程;内存结构图;线程的创建和启动;Thread的常用方法
作文以记之 ~ 二叉树的前序遍历
一个必看的微信小程序开发指南1-基础知识了解
Community group purchase applet source code + interface DIY + nearby leader + supplier + group collage + recipe + second kill + pre-sale + distribution + live broadcast
项目上传部分
Overview of bus structure
面了一圈,整理了这套面试题。。
Noyer électronique stm32 Introduction à l'Internet des objets 30 étapes notes I. différences entre la Bibliothèque Hal et la Bibliothèque standard
洋桃電子STM32物聯網入門30步筆記一、HAL庫和標准庫的區別
随机推荐
396. Rotate Function
作文以记之 ~ 二叉树的后序遍历
One click cleanup of pycharm and jupyter cache files under the project
How to encrypt devices under the interconnection of all things
synchronized 实现原理
Multi vision slam
【学习】从零开始的音视频开发(9)——NuPlayer
Idea: export Yapi interface using easyyapi plug-in
tsdf +mvs
STM32F103ZET6【标准库函数开发】----库函数介绍
How browser works
Input / output system
二维01背包
DOM learning notes - traverse all element nodes of the page
一个必看的微信小程序开发指南1-基础知识了解
使用JWT生成与解析Token
DOM学习笔记---遍历页面所有元素节点
Failed to convert a NumPy array to a Tensor(Unsupported Object type int)
监控智能回放是什么,如何使用智能回放查询录像
Overview of bus structure