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
⌛
This post has been reserved for your question.
Hey @TuckerTheMandolinist! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
What is the exact issue?
It can't find proguard .jar

I have installed proguard and there is no .jar
How did you configure Prouard?
Did you configure a main class?
Can you run the JAR before proguard?
yes
my problem is proguard.jar not existing
Can you rename it to proguard.zip?
and then show its content?
also run the
dir
command in the cmd window firsti do not have it
it didn't come with proguard when I downloaded it
Oh so the issue is you cannot run proguard?
yes, because there is no proguard.jar
What is in there?
I thought you had an issue running the minified executable

heres the bin folder
What happens when running proguard.bat from cmd?
Did your antivirus maybe delete the JAR?
I meant you run proguard.bat from inside cmd
ok

Can you show the content of the proguard.bat file?
what do you mean?
Can you show the full command you were executing to get that and the full output?
i just went into cmd and ran the command "proguard.bat"
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?
@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
Can you run proguardgui.bat?

yes
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
heres some errors i got
these are warnings from what I see
What happens when running the generated JAR?

cat
*cant
oh ok
Cab you show your configuration?
Was that file created by the GUI?
yes
theres a save configuration button
Can you show the options in the GUI?

e.g. for input/output and shrinking

Can you add
-dontwarn javax.swing.**
?
idk where exactly to add it
otherwise what happens if you disable the Swing L&F button there?same thing
What's the output with the dontwarn thing
idk where to add it
you have thag configuration
maybe put it in a file
add the
dontwarn
s (you'd also need -dontwarn java.awt.**
)
and then run proguard.bat @yourconfigfilehere
something like that maybeAre there any other ways to shrink a jar file?
i vaguely remember reading something about 7zip
💤
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.