当前位置:网站首页>Decompile the jar package / class file / modify the jar package using the decompile plug-in of idea
Decompile the jar package / class file / modify the jar package using the decompile plug-in of idea
2022-07-23 10:13:00 【To the South I】
Decompile The plugin is introduced
install IDEA after , Generally, it comes with decompiler plug-ins , Java Bytecode Decompiler
If not, you can install it yourself 
1. First find the plug-in jar package , stay IDEA Installation directory plugins Under the folder
For example, my catalog is :
E:\IDEA\plugins\java-decompiler\lib\java-decompiler.jar
2. function java command , Specify the jar Package directory and what you want to decompile jar The package directory also generates decompiled jar The package directory
The order is as follows :
java -cp “E:\IDEA\plugins\java-decompiler\lib\java-decompiler.jar” \
org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dgs=true \
D:\maven\respository\xxx\xxx-0.0.1-SNAPSHOT.jar D:\src
E:\IDEA\plugins\java-decompiler\lib\java-decompiler.jar It's my plug-in directory
D:\maven\respository\xxx\xxx-1.5.0-SNAPSHOT.jar I want to decompile jar package
D:\src I want to generate decompiled jar The package directory
When jre Version below class An error will be reported when the version of the file
error message :
Error: A JNI error has occurred, please check your installation and try again
Exception in thread “main” java.lang.UnsupportedClassVersionError: org/jetbrains/java/decompiler/main/decompiler/ConsoleDecompiler has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader 1. r u n ( U R L C l a s s L o a d e r . j a v a : 362 ) a t j a v a . s e c u r i t y . A c c e s s C o n t r o l l e r . d o P r i v i l e g e d ( N a t i v e M e t h o d ) a t j a v a . n e t . U R L C l a s s L o a d e r . f i n d C l a s s ( U R L C l a s s L o a d e r . j a v a : 361 ) a t j a v a . l a n g . C l a s s L o a d e r . l o a d C l a s s ( C l a s s L o a d e r . j a v a : 424 ) a t s u n . m i s c . L a u n c h e r 1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher 1.run(URLClassLoader.java:362)atjava.security.AccessController.doPrivileged(NativeMethod)atjava.net.URLClassLoader.findClass(URLClassLoader.java:361)atjava.lang.ClassLoader.loadClass(ClassLoader.java:424)atsun.misc.LauncherAppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
class Document version follows jdk The version correspondence is as follows
49 = Java 5
50 = Java 6
51 = Java 7
52 = Java 8
53 = Java 9
54 = Java 10
55 = Java 11
56 = Java 12
57 = Java 13
58 = Java 14
59 = Java 15
60 = Java 16
We can specify the higher version installed by ourselves JDK To run the , For example, here I use my own installation JDK11 To run the
E:\JDK\jdk11.0.10\bin\java -cp \
“E:\IDEA\plugins\java-decompiler\lib\java-decompiler.jar” \
org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dgs=true \
E:\Java_develop\Maven\repository\com\xxx\xxx\0.0.1-SNAPSHOT\xxx.jar D:\src\
3. You can decompress it directly jar package
jar A package is actually a compressed package file , Like the ones that we see all the time zip/rar
You can decompress it directly with a compression tool , Also can put the xxx.jar Change the suffix to xxx.zip After decompression
Decompress and import directly IDEA modify , After modification, compile and package
4. hit jar Package order
hit jar Package order , Match all files of the current directory file *.class The file hits jar In bag
jar cvf xxx.jar ./
Appoint manifest Package files
jar cvfm xxx.jar MANIFEST.MF *.class
边栏推荐
- 【Azure 事件中心】Azure Event Hub 新功能尝试 -- 异地灾难恢复 (Geo-Disaster Recovery)
- Can Huatai Securities open an account online? Is it safe
- 拓扑排序 & 关键路径
- 实现方法pathListToMap,能够将输入的pathList转化为具有层级结构的map类型
- 【MySQL】游标「Cursor」
- Illustration and text demonstrate the movable range of the applet movable view
- 用现代化的开发方法和思维,打跑遗留系统“拦路虎”
- 目标检测xml文件实现mixup数据增强(修改文件路径直接能用,非常方便)
- 软件质量管理实践全面总结
- 广发期货是什么级别?开户安全可靠吗?
猜你喜欢

Seven sorts -- detailed explanation of ten thousand words

枚举类的使用和实现

世界正在被开源软件吞食

网络安全之ARP欺骗防护

开源进销存系统,10分钟搞定,建议收藏!
![[BDSec CTF 2022] 部分WP](/img/00/25c1953a324fbf04e3baf592079978.png)
[BDSec CTF 2022] 部分WP

在线问题反馈模块实战(十一):实现图片下载功能

Transfer software testing salary 10K | there is food in the hand and a bottom in the heart, which is the truth at all times

30行自己写并发工具类(Semaphore, CyclicBarrier, CountDownLatch)是什么体验?

Use modern development methods and thinking to get rid of the "stumbling block" of legacy systems
随机推荐
可视化全链路日志追踪
moment 获取周、月、季、年
【MySQL】游标「Cursor」
软考 系统架构设计师 简明教程 | 需求工程
Interviewer: explain the core principle of ThreadLocal
L-半胱氨酸修饰的金纳米粒子(Cys-GNPs)和牛血清白蛋白/生物素化白蛋白纳米粒
leetcode-99.恢复二叉搜索树
这个工具,补齐了 JMeter性能分析最后一公里短板
three文档使用
网络通信原理与IP地址的分配原理,网络七层由下往上分别为物理层、数据链路层、网络层、传输层、会话层、表示层和应用层
How to classify the same field values in a list under the same list
华泰证券可以网上开户吗安全吗
用现代化的开发方法和思维,打跑遗留系统“拦路虎”
拓扑排序 & 关键路径
Time series dataset: power transformer dataset (etdataset)
【南瓜书ML】(task3)决策树(更新ing)
leetcode 1074. Number of Submatrices That Sum to Target(和为target的子矩阵个数)
卡特兰数---
non-Boost Asio 笔记: UDP UART SocketCAN Multicast UDS
目标检测xml文件实现mixup数据增强(修改文件路径直接能用,非常方便)