ProGuard Guides?

I wan't to shrink the size of my .jar file using ProGuard, but I can't figure out how it works
48 Replies
JavaBot
JavaBot2mo ago
This post has been reserved for your question.
Hey @TuckerTheMandolinist! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st2mo ago
What is the exact issue?
TuckerTheMandolinist
It can't find proguard .jar
No description
TuckerTheMandolinist
I have installed proguard and there is no .jar
dan1st
dan1st2mo ago
How did you configure Prouard? Did you configure a main class? Can you run the JAR before proguard?
TuckerTheMandolinist
yes my problem is proguard.jar not existing
dan1st
dan1st2mo ago
Can you rename it to proguard.zip? and then show its content? also run the dir command in the cmd window first
TuckerTheMandolinist
i do not have it it didn't come with proguard when I downloaded it
dan1st
dan1st2mo ago
Oh so the issue is you cannot run proguard?
TuckerTheMandolinist
yes, because there is no proguard.jar
dan1st
dan1st2mo ago
What is in there? I thought you had an issue running the minified executable
TuckerTheMandolinist
heres the bin folder
dan1st
dan1st2mo ago
What happens when running proguard.bat from cmd? Did your antivirus maybe delete the JAR?
dan1st
dan1st2mo ago
I meant you run proguard.bat from inside cmd
TuckerTheMandolinist
ok
dan1st
dan1st2mo ago
Can you show the content of the proguard.bat file?
TuckerTheMandolinist
what do you mean?
dan1st
dan1st2mo ago
Can you show the full command you were executing to get that and the full output?
TuckerTheMandolinist
i just went into cmd and ran the command "proguard.bat"
dan1st
dan1st2mo ago
Can you right-click on the proguard.bat file and select edit? What other files and directories are in the proguard installation other than bin?
TuckerTheMandolinist
@ECHO OFF REM Start-up script for ProGuard -- free class file shrinker, optimizer, REM obfuscator, and preverifier for Java bytecode. REM REM Note: when passing file names containing spaces to this script, REM you'll have to add escaped quotes around them, e.g. REM ""C:/My Directory/My File.txt"" IF EXIST "%PROGUARD_HOME%" GOTO home SET PROGUARD_HOME=%~dp0.. :home java -jar "%PROGUARD_HOME%\lib\proguard.jar" %* examples, docs, lib
dan1st
dan1st2mo ago
Can you run proguardgui.bat?
TuckerTheMandolinist
yes
dan1st
dan1st2mo ago
ok that should work in input/output, you should be enable to configure the JAR etc and then use other options and in shrinking you can do other things
TuckerTheMandolinist
heres some errors i got
dan1st
dan1st2mo ago
these are warnings from what I see What happens when running the generated JAR?
TuckerTheMandolinist
cat *cant
dan1st
dan1st2mo ago
oh ok Cab you show your configuration?
dan1st
dan1st2mo ago
Was that file created by the GUI?
TuckerTheMandolinist
yes theres a save configuration button
dan1st
dan1st2mo ago
Can you show the options in the GUI?
dan1st
dan1st2mo ago
e.g. for input/output and shrinking
dan1st
dan1st2mo ago
Can you add -dontwarn javax.swing.**? idk where exactly to add it otherwise what happens if you disable the Swing L&F button there?
TuckerTheMandolinist
same thing
dan1st
dan1st2mo ago
What's the output with the dontwarn thing
TuckerTheMandolinist
idk where to add it
dan1st
dan1st2mo ago
you have thag configuration maybe put it in a file add the dontwarns (you'd also need -dontwarn java.awt.**) and then run proguard.bat @yourconfigfilehere something like that maybe
TuckerTheMandolinist
Are there any other ways to shrink a jar file? i vaguely remember reading something about 7zip
JavaBot
JavaBot2mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?