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
JavaBot4mo 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
dan1st4mo ago
What is the exact issue?
moocher
moocherOP4mo ago
It can't find proguard .jar
No description
moocher
moocherOP4mo ago
I have installed proguard and there is no .jar
dan1st
dan1st4mo ago
How did you configure Prouard? Did you configure a main class? Can you run the JAR before proguard?
moocher
moocherOP4mo ago
yes my problem is proguard.jar not existing
dan1st
dan1st4mo ago
Can you rename it to proguard.zip? and then show its content? also run the dir command in the cmd window first
moocher
moocherOP4mo ago
i do not have it it didn't come with proguard when I downloaded it
dan1st
dan1st4mo ago
Oh so the issue is you cannot run proguard?
moocher
moocherOP4mo ago
yes, because there is no proguard.jar
dan1st
dan1st4mo ago
What is in there? I thought you had an issue running the minified executable
moocher
moocherOP4mo ago
No description
moocher
moocherOP4mo ago
heres the bin folder
dan1st
dan1st4mo ago
What happens when running proguard.bat from cmd? Did your antivirus maybe delete the JAR?
moocher
moocherOP4mo ago
dan1st
dan1st4mo ago
I meant you run proguard.bat from inside cmd
moocher
moocherOP4mo ago
ok
moocher
moocherOP4mo ago
No description
dan1st
dan1st4mo ago
Can you show the content of the proguard.bat file?
moocher
moocherOP4mo ago
what do you mean?
dan1st
dan1st4mo ago
Can you show the full command you were executing to get that and the full output?
moocher
moocherOP4mo ago
i just went into cmd and ran the command "proguard.bat"
dan1st
dan1st4mo 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?
moocher
moocherOP4mo ago
@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
dan1st4mo ago
Can you run proguardgui.bat?
moocher
moocherOP4mo ago
No description
moocher
moocherOP4mo ago
yes
dan1st
dan1st4mo 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
moocher
moocherOP4mo ago
moocher
moocherOP4mo ago
heres some errors i got
dan1st
dan1st4mo ago
these are warnings from what I see What happens when running the generated JAR?
moocher
moocherOP4mo ago
No description
moocher
moocherOP4mo ago
cat *cant
dan1st
dan1st4mo ago
oh ok Cab you show your configuration?
moocher
moocherOP4mo ago
dan1st
dan1st4mo ago
Was that file created by the GUI?
moocher
moocherOP4mo ago
yes theres a save configuration button
dan1st
dan1st4mo ago
Can you show the options in the GUI?
moocher
moocherOP4mo ago
No description
dan1st
dan1st4mo ago
e.g. for input/output and shrinking
moocher
moocherOP4mo ago
No description
dan1st
dan1st4mo 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?
moocher
moocherOP4mo ago
same thing
dan1st
dan1st4mo ago
What's the output with the dontwarn thing
moocher
moocherOP4mo ago
idk where to add it
dan1st
dan1st4mo 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
moocher
moocherOP4mo ago
Are there any other ways to shrink a jar file? i vaguely remember reading something about 7zip
JavaBot
JavaBot4mo 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?