Comments (14)
The exception is thrown on startup, re-producable with master branch.
from recaf.
Looks like it's an osx LAF issue in combination with how I handle applying themes. According to https://lists.apple.com/archives/java-dev/2010/Mar/msg00181.html
You are using the Aqua Look and Feel's ScreenMenuBar, without having Aqua actually installed: this is not supported.
I think the solution would be calling UIManager's install(lafName, lafClass)
with the com/apple/laf/AquaLookAndFeel
class for osx users. Hopefully a small plugin can fix this.
from recaf.
I pushed a commit to master
which shifts the order of displaying the UI to after plugins load. Can you build recaf from it and plop this plugin (jar inside the zip) into your <recaf>/plugins
folder?
Plugin contents:
public class OsxThemeFix implements Plugin {
@Override
public void init() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
UIManager.installLookAndFeel("Aqua", "com.apple.laf.AquaLookAndFeel");
}
});
}
}
from recaf.
The error stays the same
%> ls plugins/
./ ../ OsxThemeFix.jar
%> mvn clean package
...
%> java -jar target/recaf-0.9-jar-with-dependencies.jar
[INFO:2/1/18 11:21 AM] Setting up Recaf
[INFO:2/1/18 11:21 AM] Loading config
[INFO:2/1/18 11:21 AM] Loading config: ASM
[INFO:2/1/18 11:21 AM] Loading config: Theme
[INFO:2/1/18 11:21 AM] Loading config: UserInterface
[window.method.opcode.edit, window.method.opcode.new.before, window.method.opcode.new.after, window.method.opcode.move.up, window.method.opcode.move.down, window.method.opcode.gotodef, window.method.opcode.gotojump, window.method.opcode.saveblock, window.method.opcode.insertblock, window.method.opcode.remove]
[window.member.decompile, window.member.vars, window.member.editopcodes, window.member.catch, window.member.verify, window.member.define, window.member.search, window.member.add, window.member.remove]
[INFO:2/1/18 11:21 AM] Loading config: CodeBlocks
[INFO:2/1/18 11:21 AM] Loading config: Agent
[FINE:2/1/18 11:21 AM] Loading language from: /resources/lang/en.json
[INFO:2/1/18 11:21 AM] Loading attach api
[INFO:2/1/18 11:21 AM] Creating UI
[INFO:2/1/18 11:21 AM] Loading plugins
[INFO:2/1/18 11:21 AM] Displaying UI
[INFO:2/1/18 11:21 AM] Finished setup
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.apple.laf.AquaMenuPainter.paintMenuBarBackground(AquaMenuPainter.java:145)
at com.apple.laf.AquaMenuBarUI.paint(AquaMenuBarUI.java:74)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
at javax.swing.JComponent.paintComponent(JComponent.java:780)
at javax.swing.JComponent.paint(JComponent.java:1056)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
...
from recaf.
Ok then it looks like I have to re-evaluate how theme's are applied. The plugin probably doesn't work because there's still a delay in setting the theme (which was put in place due to a non-delayed execution resulting in incomplete theme-application). I can't easily test this alone since I don't have any apple computers.
from recaf.
No problem, it's not a fatal error anyway. Perhaps this would help https://stackoverflow.com/questions/23201030/what-is-a-look-and-feel-that-is-compatible-with-mac
from recaf.
If you put UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
at the beginning on main
does the exception get raised?
from recaf.
In main()
public static void main(String[] args) {
try {
System.out.println("before setLookAndFeel");
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
System.out.println("after setLookAndFeel");
} catch (Exception e) {
e.printStackTrace();
}
LaunchParams params = new LaunchParams();
start(args, params);
}
Output
%> java -jar target/recaf-0.9-jar-with-dependencies.jar
before setLookAndFeel
after setLookAndFeel
[INFO:2/1/18 2:54 PM] Setting up Recaf
[INFO:2/1/18 2:54 PM] Loading config
from recaf.
Does that mean adding the system LAF to main resolves the exception?
from recaf.
Yes, set LAF in main works, no exception :-P
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
} catch (Exception e) {
e.printStackTrace();
}
LaunchParams params = new LaunchParams();
start(args, params);
}
from recaf.
OK I'll work it into a commit later today.
from recaf.
It works by now but I found another bug. There are three "Java Programs" in the file dialog ...
from recaf.
Should be put under an issue of it's own but it looks fine on my end.
from recaf.
Looks like a compiler cache issue, the problem is now gone ...
from recaf.
Related Issues (20)
- "Failed to analyze phantom references for primary resource java.lang.IllegalStateException: null" with v14 but works with v13 HOT 4
- Uncaught exception when trying to open assembler panel for method HOT 4
- How to import a new package HOT 2
- Unable to find Assembler Option HOT 2
- Apple default key bindings HOT 3
- Collapsible code blocks
- Add Discord Rich Presence Support HOT 1
- Add keybinds to rename packages and classes in the file tree
- idk if am dumb HOT 10
- Crash on macos HOT 1
- Default package HOT 2
- classtree search? HOT 1
- Failed Recompilation: "Please only rename inner classes via mapping operations." HOT 1
- Please only rename inner classes via mapping operations. HOT 4
- Reverse/Decompile Exe's & DLL's
- some suggestions HOT 4
- Class Copy Feature HOT 1
- Field Value Inserting (Recaf 4x) HOT 1
- Text on recaf are wrong cant read HOT 3
- Support Latest LTS Release/Java 21 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recaf.