Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8073503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:21:30+00:00 2026-06-05T14:21:30+00:00

I have written an application in Java for both Mac OSx and Windows, but

  • 0

I have written an application in Java for both Mac OSx and Windows, but I’ve developed it on Windows. Therefore I used java.lang.reflect.* in order to implement the ‘About’ and ‘Quit’ handler without receiving exceptions.

I’ve exported it as an Executable Jar and everything works fine on both operating systems. However, I want to obfuscate the application and I’m using ProGaurd to do so. I’ve specified the necessary libraries for it to work on Windows (rt.jar, jsse.jar, jce.jar) and it still does work fine on Windows, however ProGaurd is telling me that there is two unresolved dynamic references to classes or interfaces, and the obfuscated application no longer works properly on Mac (the About and Quit Handler don’t work).

I read somewhere that the ui.jar was required, so I copied it accross from my Mac and specified it in ProGaurd but that did not seem to solve the problem! Any solutions appreciated then…

Thanks in advance

UPDATE

I have now used AppleJavaExtensions in order to implement the handlers using com.apple.eawt.Application rather than reflect. However, I’m still getting the exact same problem! Here is the code that I am currently using:

package ap;
import com.apple.eawt.AboutHandler;
import com.apple.eawt.AppEvent;
import com.apple.eawt.AppEvent.QuitEvent;
import com.apple.eawt.Application;
import com.apple.eawt.QuitHandler;
import com.apple.eawt.QuitResponse;
import com.gui.Tabs;

public class xa implements AboutHandler, QuitHandler {

    // Constructor to register/install the necessary handler's
    public xa(){
        Application.getApplication().setAboutHandler(this);
        Application.getApplication().setQuitHandler(this);
    }

    // Implemented method to catch the About menu item
    @Override
    public void handleAbout(AppEvent.AboutEvent e) {
        Tabs.switchAbout();

    }

    // Implemented method to catch the Quit menu item
    @Override
    public void handleQuitRequestWith(QuitEvent arg0, QuitResponse arg1) {
        Tabs.quit();        
    }
}

AND I am using the ProGuard GUI to obfuscate my application. In Obsfucation ‘tab’ at the bottom I’ve added class ap.xa and specified that it extends/implements AboutHandler, QuitHandler. I’ve also added the Class com.gui.Tabs but it the problem still occurs.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:21:31+00:00Added an answer on June 5, 2026 at 2:21 pm

    Opps, I’ve solved the problem… And I only made a silly mistake

    Because I’m using the ProGuard GUI, I failed to see the “Class members” part in the addition screen. Therefore, whilst ProGuard wasn’t obfuscating the class itself, it was obfuscating the methods, hence the listeners not working. So, I’ve ended up ‘keeping’ ap.xa and all it’s methods (the class containing the actually listeners), and com.apple.** (the JavaAppleExtensions package)

    However, there is still one thing occurring. When I run the obfuscated JAR file from Terminal I receive the following output:

    Andrews-MacBook-Pro:~ Andy$ java -jar /Users/Andy/Desktop/YLIT\ Final\ 2.jar
    Jun  9 20:50:29 Andrews-MacBook-Pro.local java[959] <Error>: CGContextGetCTM: invalid context 0x0
    Jun  9 20:50:29 Andrews-MacBook-Pro.local java[959] <Error>: CGContextSetBaseCTM: invalid context 0x0
    Jun  9 20:50:29 Andrews-MacBook-Pro.local java[959] <Error>: CGContextGetCTM: invalid context 0x0
    Jun  9 20:50:29 Andrews-MacBook-Pro.local java[959] <Error>: CGContextSetBaseCTM: invalid context 0x0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web-based application and a client, both written in Java. For what
The class I have written works fine as a normal Java application, but when
I have web application written in java using Eclipse. It has just one servlet
I have this application written in java to calculate pageranks. And the application takes
I have a web-application written in java. I would like to run integration tests
We have a rather large and complex application written in Java which is running
Background: I have written a java swing based client server application. The server is
In our application, I have seen code written like this: User.java (User entity) public
i have written an application, but for some reason it keeps peaking at 100%.
I have written an image processing application with the GUI part written in Java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.