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 8435735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:59:38+00:00 2026-06-10T06:59:38+00:00

I was trying to learn how to use ProGuard , and it is no

  • 0

I was trying to learn how to use ProGuard, and it is no way as easy as I thought. At first I found a simple Java code to try it, a simple two class Swing calculator.

The code can be found by following that link, but I found it too verbose to post the it here. Anyway, it is a plain application with entry point on Calc.main(), there are no packages.

Then I compiled both sources with:

$ javac *.java

and created the .jar file (because it seems ProGuard only work with jars):

$ jar cvef Calc calc.jar *.class
added manifest
adding: Calc.class(in = 3869) (out= 2126)(deflated 45%)
adding: Calc$ClearListener.class(in = 468) (out= 327)(deflated 30%)
adding: CalcLogic.class(in = 1004) (out= 515)(deflated 48%)
adding: Calc$NumListener.class(in = 1005) (out= 598)(deflated 40%)
adding: Calc$OpListener.class(in = 1788) (out= 1005)(deflated 43%)

Wrote the ProGuard file named obfuscate.pro:

-injars       calc.jar
-outjars      calc_obf.jar
-libraryjars  <java.home>/lib/rt.jar

-keep public class Calc extends javax.swing.JFrame {
public static void main(java.lang.String[]);
}

And finally run ProGuard:

$ ~/progs/proguard/proguard4.8/bin/proguard.sh @obfuscate.pro
ProGuard, version 4.8
Reading program jar [/home/lucas/tmp/calc.jar]
Reading library jar [/usr/lib/jvm/java-7-openjdk-i386/jre/lib/rt.jar]
Error: The output jar is empty. Did you specify the proper '-keep' options?

Well, obviously didn’t work. I got tired of messing with ProGruard parameters, specially with that -keep options, with no success. All I found in the docs related to my problem could not help me. Then I am resorting to you… What is wrong? How to do it right?

  • 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-10T06:59:39+00:00Added an answer on June 10, 2026 at 6:59 am

    I got it to work using the following configuration file:

    -injars       calc.jar
    -outjars      calc_obf.jar
    -libraryjars  <java.home>/lib/rt.jar
    -keep class Calc {
      public static void main(java.lang.String[]);
    }
    

    Most notably, I ditched the public in front of class Calc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying to learn how to use Java Swing's GroupLayout. First of all I
I am trying to learn how to use the AsyncTask class to authenticate the
I'm trying to learn how to use managed/unmanaged code interop, but I've hit a
I am trying to learn to use the chrome.tabs.executeScript commend. I've created a simple
I'm trying to learn how to use OpenMP by parallelizing a monte carlo code
I am trying to learn how to use JSON and writing a simple program
I'm trying to learn to use xml in Java (Android platform, using Eclipse and
I am trying to learn to use C# serialization as a way to save
I am trying to learn to use mercurial by pushing onto Google code. I
I'm trying to learn to use Yelp's Python API for MapReduce, MRJob. Their simple

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.