当前位置:网站首页>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
边栏推荐
- Situational leaders - Chapter 7, solving performance problems
- 信息收集相关知识点及题解
- Sword finger offer Day24 math (medium)
- 对li类数组对象随机添加特性,并进行排序
- 【学习】从零开始的音视频开发(9)——NuPlayer
- RPC procedure
- 项目上传部分
- 5.6 综合案例-RTU-
- Use of applicationreadyevent
- WordPress love navigation theme 1.1.3 simple atmosphere website navigation source code website navigation source code
猜你喜欢

396. Rotate Function

面了一圈,整理了这套面试题。。

Overview of bus structure

Knowledge points and problem solutions related to information collection

excle加水印

My heart's broken! A woman's circle of friends envied others for paying wages on time and was fired. Even her colleagues who liked her were fired together

洋桃電子STM32物聯網入門30步筆記一、HAL庫和標准庫的區別

作文以记之 ~ 二叉树的前序遍历

四张图弄懂matplotlib的一些基本用法

A simple theme of Typecho with beautiful appearance_ Scarfskin source code download
随机推荐
什么是RPC
《深度学习》学习笔记(八)
LINQ学习系列-----1.4 匿名对象
QFileDialog select multiple files or folders
Ansible Automation Operation and Maintenance details (ⅰ) Installation and Deployment, Parameter use, list Management, Profile Parameters and user level ansible operating environment Construction
[explanation] get ora-12838: cannot read / modify an object after modifying it in parallel
Add random attributes to the Li class array objects and sort them
Asan minimalism
Online app resource download website source code
How to encrypt devices under the interconnection of all things
npm安装yarn
Copy array in JS
Redis Desktop Manager for Mac(Redis可视化工具)
Data deletion and modification (MySQL)
关于cin,scanf和getline,getchar,cin.getline的混合使用
第一性原理 思维导图
测试你的机器学习流水线
Search the complete navigation program source code
Goland 调试go使用-大白记录
作文以记之 ~ 二叉树的前序遍历