#how to make zip into jar

1 messages · Page 1 of 1 (latest)

late plinth
#

can anyone tell me how you make a zip a jar? i used jar cf command, have java 22 installed, it isnt working, am i dumb? i feel dumb rn lol

lethal lintelBOT
#

<@&987246652869971988> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#
TJ-Bot
Can anyone tell me how you make a zip a jar? i used jar cf command, have java 22 installed, it isnt working, am i dumb? i feel dumb rn lol

To convert a ZIP file into a JAR file, you can follow these steps:

  1. Make sure you have Java Development Kit (JDK) installed on your system.

  2. Rename the ZIP file extension to .jar.

  3. Open Command Prompt (CMD) or Terminal.

  4. Use the following command to convert the ZIP to JAR:
    jar cf yourfilename.jar -C yourzipfile.zip .

  5. Press Enter and wait for the process to complete.

If you are still facing issues with the conversion, double-check that you have correctly renamed the file extension and that there are no errors in the command syntax. Additionally, ensure that you are running the command in the correct directory where your ZIP file is located. If you continue to encounter problems, feel free to ask for further assistance on this Discord server or seek help from online resources. Remember, making mistakes is a part of learning, so don't be too hard on yourself!

sharp bobcat
#

it isnt working

#

what exactly?

late plinth
#

oh maybe i dont have the development kit

sharp bobcat
#

what did you do and what is not working

late plinth
#

maybe i just installed normal java

sharp bobcat
late plinth
sharp bobcat
#

well it depends if you have jre (runtime environment) or jdk (development kit)

late plinth
#

yeah i might have jre i didnt realise there was a difference

late plinth
#

but i might have figured it out acc

sharp bobcat
#

well you still didnt say why its failing

#

what exact command are you trying to do with jar

late plinth
#

just make a file a jar dw i figured it out u just rename the file lol

#

idk what i was reading

topaz totem
#

A jar isn't zipping up your java files and renaming it from .zip to .jar.

short silo
#

also why do you have a zip

#

it makes no sense

#

you are supposed to create a jar from class files

hearty horizon
#

not because its wrong

#

but because

#
jar \
  --create \
  --file out.jar \
  -C build/classes .
#

sure is easier to read

late plinth
late plinth
late plinth
#

Is there a way to edit my post to show it is solved

short silo
#

also it won't work if you are trying to run it

#

and

#

you shouldn't do any of that at the first place and instead use a build tool

sharp bobcat
#

I think this is related to some mod or similar

#

and thus it works

late plinth
sharp bobcat
#

wut

#

editing?

#

how did you do that?

late plinth
#

Yeah an nbt file was crashing my game so I extracted it, removed the file, zipped, renamed to jar and now it works

topaz totem
#

Hmm, now I wonder how it's handling that file not found.

late plinth
#

A mushroom pond or smth

late plinth
late plinth
final meteor
#

Well they have to be compiled obviously but

half mist
#

ik you can rename .jar to .zip and it works

topaz totem