zxh0 / classpy Goto Github PK
View Code? Open in Web Editor NEWGUI tool for investigating Java class files
License: MIT License
GUI tool for investigating Java class files
License: MIT License
Java Environment
openjdk 15.0.2 2021-01-19
OpenJDK Runtime Environment Corretto-15.0.2.7.1 (build 15.0.2+7)
OpenJDK 64-Bit Server VM Corretto-15.0.2.7.1 (build 15.0.2+7, mixed mode, sharing)
After following the command to build and run
cd path/to/classpy
./gradlew fatJar
./gradlew run
The GUI menu font not displayed correctly.
Seems like the font style is not set, after I set the scene style in ClasspyApp.java
, it works.
scene.getRoot().setStyle("-fx-font-family: 'serif'");
在windows系统可以使用的
错误: 找不到或无法加载主类 com.github.zxh.classpy.gui.ClasspyApp
原因: java.lang.NoClassDefFoundError: javafx/application/Application
我使用java 1.8、gradle 3.1构建的项目;当执行build/scripts/classpy文件的时候出现
Error: Could not find or load main class com.github.zxh.classpy.gui.ClasspyApp
classpy HelloWorld.class
错误: 找不到或无法加载主类 com.github.zxh.classpy.gui.ClasspyApp
原因: java.lang.NoClassDefFoundError: javafx/application/Application
如题,Java源码如下所示:
package jvmgo.book.ch03;
public class ClassFileTest {
public static final boolean FLAG = true;
public static final byte BYTE = 123;
public static final char X = 'X';
public static final short SHORT = 12345;
public static final int INT = 123456789;
public static final long LONG = 12345678901L;
public static final float PI = 3.14f;
public static final double E = 2.71828;
public static void main(String[] args) throws RuntimeException {
System.out.println("Hello, World!");
}
}
对于其中的public static final long LONG = 12345678901L;
进行解析是,在常量池中,这个12345678901L
解析出现错误。错误截图如下所示:
javap -v
的结果如下所示:
执行 brew tap guxingke/repo && brew install classpy
Error: classpy: /usr/local/Homebrew/Library/Taps/guxingke/homebrew-repo/Formula/classpy.rb:10:
@8' is not allowed as an instance variable name
/usr/local/Homebrew/Library/Taps/guxingke/homebrew-repo/Formula/classpy.rb:10: syntax error, unexpected end-of-input, expecting end
depends_on :openjdk@8
`
which transfer bytecode to jvm instructions .
gradle官网国内被墙多年,构建多有不便。
When I try Command:
brew tap guxingke/repo
It shows:
==> Tapping guxingke/repo
Cloning into '/usr/local/Homebrew/Library/Taps/guxingke/homebrew-repo'...
remote: Enumerating objects: 44, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 44 (delta 0), reused 2 (delta 0), pack-reused 40
Unpacking objects: 100% (44/44), done.
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/guxingke/homebrew-repo/Formula/classpy.rb
classpy: /usr/local/Homebrew/Library/Taps/guxingke/homebrew-repo/Formula/classpy.rb:10: `@8' is not allowed as an instance variable name
/usr/local/Homebrew/Library/Taps/guxingke/homebrew-repo/Formula/classpy.rb:10: syntax error, unexpected end-of-input, expecting end
depends_on :openjdk@8
^
Error: Cannot tap guxingke/repo: invalid syntax in tap!
如有需要,乐意效劳.
./gradlew fatJar
Downloading https://services.gradle.org/distributions/gradle-6.7-bin.zip
.........10%..........20%..........30%..........40%..........50%.........60%..........70%..........80%..........90%..........100%
Welcome to Gradle 6.7!
Here are the highlights of this release:
- File system watching is ready for production use
- Declare the version of Java your build requires
- Java 15 support
For more details see https://docs.gradle.org/6.7/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
java.lang.UnsupportedClassVersionError: org/openjfx/gradle/JavaFXPlugin 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
> org/openjfx/gradle/JavaFXPlugin 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
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 40s
build与run都不成功,提示“程序包javafx.scene.image不存在”,是不是与我使用的是openJDK有关?
brew tap guxingke/repo && brew install classpy
$ java --version
java 15.0.1 2020-10-20
Java(TM) SE Runtime Environment (build 15.0.1+9-18)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)
$ classpy hello.class
Error: Could not find or load main class com.github.zxh.classpy.gui.ClasspyApp
Caused by: java.lang.NoClassDefFoundError: javafx/application/Application
why not simplify the run operation? like a .exe
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.