Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The compiled jar is too large #1434

Closed
purofle opened this issue Nov 21, 2021 · 3 comments
Closed

The compiled jar is too large #1434

purofle opened this issue Nov 21, 2021 · 3 comments
Assignees
Labels
native distribution question Not a bug, but question or comment

Comments

@purofle
Copy link

purofle commented Nov 21, 2021

I compiled a jar with ./gradlew packageUberJarForCurrentOS and it works well.But this jar is too large(almost 75mb).

After unpacking this jar, I found that there is almost a complete kotlin in jar/org/jetbrains/kotlin.

Is it a bug?
(I'm sorry for my English is very poor)

@akurasov akurasov added native distribution question Not a bug, but question or comment labels Nov 22, 2021
@olonho
Copy link
Contributor

olonho commented Nov 22, 2021

What is expected behavior for you? This jar is intended to contain all deps.

@AlexeyTsvetkov
Copy link
Collaborator

AlexeyTsvetkov commented Nov 22, 2021

@purofle you can use Proguard to shrink the resulting jar https://www.guardsquare.com/manual/setup/gradle

However, this process might not work completely automatically, because ProGuard might remove some actually used classes (e.g. classes that are used through reflection). Sadly, we can't fully automate removal of potentially unnecessary classes.

@MrStahlfelge
Copy link

Please see #1174 for some suggestions how to use ProGuard

@purofle purofle closed this as completed Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
native distribution question Not a bug, but question or comment
Projects
None yet
Development

No branches or pull requests

5 participants