Open PNHost opened 2 years ago
./remap.sh: line 41: zip: command not found
makes me believe that you don't have zip
in your PATH.
If you're running the bash file with Git Bash on Windows, you could try this Stackoverflow answer. Alternatively, you could install MSYS2 and use pacman
to install zip
if the base installation doesn't provide it (pacman -S zip
).
Sadly, I can't help you if you're using macOS, but if their base system doesn't include zip
, installing something like Info-ZIP would be the first step. I'm using Info-ZIP on my (GNU/Linux) distribution to provide the zip
binary.
I followed the StackOverflow post, and it still occurs. I only get the first error so far
If the error message still contains zip: command not found
, the zip
binary is not in your PATH (in Bash, you should be able to confirm that with which zip
).
Modern (or custom) installations of Git might have different install paths. You can print the current contents of PATH
with
echo $PATH
While I expect Git Bash's built-in bin
directory path to be in a more Unix-like format, you can most likely identify it in the Git installation directory.
Alternatively, you could try a project like MSYS2. Even if its base
group doesn't contain zip
, MSYS ships with a package manager, so you should be able to install zip
with
pacman -S zip
It doesn't contain the error when I run "which zip", however when I try ./build.sh it shows the error again.
I can confirm that in my default installation of Git on Windows, there's no copy of Info-ZIP's ZIP installed.
@RoccoDev surprisingly, Windows doesn't have much support for managing ZIP files from the command line. Since it is not straightforward to mix MSYS2 installations and Git for Windows (because of Cygwin problems), do you think we should provide a more self-contained means to modify the Minecraft JAR? IIRC, Java itself has (limited) support for managing JAR/ZIP files.
@PrismoidNW meanwhile, you could try manually removing log4j from the Minecraft JAR file:
work
directory in the KigPaper root directory./build.sh
once in Git Bash (this should still fail as zip
is not found)work/1.8.8
in the KigPaper directory1.8.8-nolog4j.jar
to 1.8.8-nolog4j.zip
log4j
folder in org/apache/logging
1.8.8-nolog4j.zip
back to 1.8.8-nolog4j.jar
1.8.8-cl.jar
if it exists./build.sh
againPlease note that, currently, you need Java 8 to build KigPaper this way: java -version
should print something like 1.8.0_342
.
Additionally, you will need a working installation of Apache Maven in your PATH.
If you run into the java.util.zip.ZipException: zip END header not found
issue again if any of the previous steps go wrong (e.g. if you try to use Java 17 to apply class mappings), you should delete work/1.8.8/1.8.8-cl.jar
and try again.
I found out that the org/apache/logging folder is just empty.
./remap.sh: line 41: zip: command not found
makes me believe that you don't havezip
in your PATH.If you're running the bash file with Git Bash on Windows, you could try this Stackoverflow answer. Alternatively, you could install MSYS2 and use
pacman
to installzip
if the base installation doesn't provide it (pacman -S zip
).Sadly, I can't help you if you're using macOS, but if their base system doesn't include
zip
, installing something like Info-ZIP would be the first step. I'm using Info-ZIP on my (GNU/Linux) distribution to provide thezip
binary.
./remap.sh: line 41: zip: command not found
is also present in the GitHub Actions log.
https://github.com/ProjectKig/KigPaper/runs/6780682041?check_suite_focus=true#step:7:185
I had similar issues when I cloned the repo on Windows then used dos2unix *
to convert CRLF to LF. Then either running ./build.sh
in WSL or in Windows via docker build container threw me the same issue that was mentioned above.
I cloned the repo in WSL then ran the docker build container on Windows without any issues. Then I tried running ./build.sh
in WSL which failed, but I suppose that's because I was using Java 18 and was lazy to downgrade to an actually supported Java version.
docker command: docker build -t ghcr.io/projectkig/kigpaper/kig-paper-builder:ver-1.8.8 -f docker\build.Dockerfile .
Then I used the following command to pull the compiled paper.jar from the build container: docker run -v C:/Users/USERNAME/Desktop:/opt/mount --rm --entrypoint cp ghcr.io/projectkig/kigpaper/kig-paper-builder:ver-1.8.8 /build/PaperSpigot-Server/target/paperspigot-1.8.8-R0.1-SNAPSHOT.jar /opt/mount/
(thanks for the copy command)
EDIT: starting the server gave this error:
PS C:\lol> & 'C:\Program Files\Java\jre1.8.0_333\bin\java' -jar .\paperspigot-1.8.8-R0.1-SNAPSHOT.jar
Loading libraries, please wait...
java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.WindowsAnsiOutputStream
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.apache.logging.log4j.core.appender.ConsoleAppender.getOutputStream(ConsoleAppender.java:128)
at org.apache.logging.log4j.core.appender.ConsoleAppender.getManager(ConsoleAppender.java:104)
at org.apache.logging.log4j.core.appender.ConsoleAppender.createAppender(ConsoleAppender.java:99)
at org.apache.logging.log4j.core.config.DefaultConfiguration.<init>(DefaultConfiguration.java:53)
at org.apache.logging.log4j.core.LoggerContext.<init>(LoggerContext.java:63)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.locateContext(ClassLoaderContextSelector.java:217)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:114)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:81)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:83)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:34)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:387)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:322)
at net.minecraft.server.v1_8_R3.MinecraftServer.<clinit>(MinecraftServer.java:53)
at org.bukkit.craftbukkit.Main.main(Main.java:201)
The Docker issue has been fixed in e1bae31, could you try building that instead?
The server startup issue was Windows only, so I've opened a new issue at https://github.com/ProjectKig/KigPaper/issues/17
build.sh
didn't crash in ArchWSL after switching to Java 8. (it's still building, I'll edit once it finishes, but it got past the crash point), although that shouldn't be related to a change in the docker container, since I wasn't using docker.
Yea, I still get the issue even after the commit.
I'm getting this error when running "build.sh"
First, run
Second run