google / google/j2objc

jarjar.rules file creates wrong j2objc.jar

Open
#1,805 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
6k
Forks
999
Avg merge
19h 20m
Merged PRs (30d)
14

Description

What did I do?
git clone the project.
execute ```make dist```

build fails:
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Sets
at com.google.devtools.j2objc.Options.(Options.java:128)
at com.google.devtools.j2objc.J2ObjC.main(J2ObjC.java:159)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Sets
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 2 more

I found that the problem is about the file https://github.com/google/j2objc/blob/master/translator/jarjar.rules

This file should be empty. Otherwise, it moves Sets.java binary (several Set*.class files) into the wrong directory.
I can make a PR in order to resolve this issue. But before I want to know what's the actual reason for jarjar.rules?
How does it work here? What should I do right now?
My Macbook has M1 arch and I use this JAVA version.
15.0.2 (x86_64) "Oracle Corporation" - "Java SE 15.0.2" /Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.