jvm-bytecode

Dynamic Java Bytecode Manipulation Framework Comparison

半城伤御伤魂 提交于 2019-11-28 16:20:09
问题 There are some frameworks out there for dynamic bytecode generation, manipulation and weaving (BCEL, CGLIB, javassist, ASM, MPS). I want to learn about them, but since I don't have much time to know all the details about all of them, I would like to see a sort of comparison chart saying the advantages and disadvantages of one versus the others and an explanation of why. Here in SO, I found a lot of questions asking something similar, and the answers normally said "you can use cglib or ASM",

Is there a clever way to determine the length of Java bytecode instructions?

隐身守侯 提交于 2019-11-28 12:40:40
问题 I'm creating a static analysis tool for Java, and there's some information about the programs I'm analyzing that will be easier to get if I can get it from the bytecode in .class files. I don't care about every single one the instructions that might be in the class file. E.g., I might only need to see if there are any getfield instructions. The problem is that since each instruction has a variable length, it seems that in the general case, I need to (in my code) specify the length of every

Tool to read and display Java .class versions

纵然是瞬间 提交于 2019-11-26 23:51:57
Do any of you know of a tool that will search for .class files and then display their compiled versions? I know you can look at them individually in a hex editor but I have a lot of class files to look over (something in my giant application is compiling to Java6 for some reason). staffan Use the javap tool that comes with the JDK. The -verbose option will print the version number of the class file. > javap -verbose MyClass Compiled from "MyClass.java" public class MyClass SourceFile: "MyClass.java" minor version: 0 major version: 46 ... To only show the version: WINDOWS> javap -verbose

Kotlin Bytecode - How to analyze in IntelliJ IDEA?

僤鯓⒐⒋嵵緔 提交于 2019-11-26 13:29:14
I want to see the compiled bytecode so I can learn more about how it works under the cover. I'm using IntelliJ IDEA 15 but can't find a way to see the bytecode. What am I missing? IntelliJ IDEA comes with a bytecode viewing tool for Kotlin: Tools → Kotlin → Show Kotlin Bytecode Also available through Ctrl / ⌘ + Shift + A as Show Kotlin Bytecode action. It's a great tool that can jump to the corresponding bytecode when you move around in the source file. And it updates the bytecode on the fly whenever the source changes. Also, I'd like to recommend jclasslib Bytecode Viewer as an external tool

Tool to read and display Java .class versions

自古美人都是妖i 提交于 2019-11-26 08:48:22
问题 Do any of you know of a tool that will search for .class files and then display their compiled versions? I know you can look at them individually in a hex editor but I have a lot of class files to look over (something in my giant application is compiling to Java6 for some reason). 回答1: Use the javap tool that comes with the JDK. The -verbose option will print the version number of the class file. > javap -verbose MyClass Compiled from "MyClass.java" public class MyClass SourceFile: "MyClass

Kotlin Bytecode - How to analyze in IntelliJ IDEA?

那年仲夏 提交于 2019-11-26 02:57:56
问题 I want to see the compiled bytecode so I can learn more about how it works under the cover. I\'m using IntelliJ IDEA 15 but can\'t find a way to see the bytecode. What am I missing? 回答1: IntelliJ IDEA comes with a bytecode viewing tool for Kotlin: Tools → Kotlin → Show Kotlin Bytecode Also available through Ctrl / ⌘ + Shift + A as Show Kotlin Bytecode action. It's a great tool that can jump to the corresponding bytecode when you move around in the source file. And it updates the bytecode on