How to Edit and Compile Java Jar Files

Поделиться
HTML-код
  • Опубликовано: 7 фев 2025
  • In this video I show a basic and simple process to edit and make changes to a JAR file. I use the following Java Decompiler to de-compile the class files in the jar file.
    Java Decompiler (JD-GUI): java-decompiler...
    What is a JAR File?
    A JAR is a package file format typically used to aggregate many Java class files and associated metadata and resources into one file for distribution. JAR files are archive files that include a Java-specific manifest file. They are built on the ZIP format and typically have a .jar file extension.
    Hit Like and Subscribe if you found it helpful.
    Thanks.

Комментарии • 153

  • @AzaleaTFG
    @AzaleaTFG 7 месяцев назад +7

    thank you, i wanted to make a simple change and all the reddit resources kept saying don't do it because you will mess up, but its just changing a mods units and adding a few files.

  • @kylecaudill9261
    @kylecaudill9261 2 года назад +11

    Thank you. I look forward to editing my game files.

    • @GetCrouchedOnNerd
      @GetCrouchedOnNerd 2 года назад

      My minecraft world looks loke the biblically accurate angels now

    • @埊
      @埊 Год назад

      @@GetCrouchedOnNerd Enchantcally accurate worlds

    • @CinemaIsG0ne
      @CinemaIsG0ne 11 месяцев назад

      same!!

  • @chaunceywei8430
    @chaunceywei8430 Месяц назад

    if this class doesn't have relation with other jar , this is a good method. otherwise , you will get a lot of error while you compiler the java file to class file

  • @FBI_Agent_
    @FBI_Agent_ 2 месяца назад

    So anyone getting the errors here is what you do; Move the .java files to the ORIGINAL FILE LOCATION where all your .jar .zip and _class and _java files are then open cmd as he does in the video and run the command as he does and if your getting errors still do the -classpath (Then the name of your decompiled.jar file).

  • @jiocrestfall
    @jiocrestfall 5 месяцев назад +6

    i followed the steps and kept going fine up til i needed to compile the java file i wanted to edit: a hundred errors being shown out of 300+ saying "item does not exist" for almost all the lines
    pls help :

    • @jcz8225
      @jcz8225 4 месяца назад

      Hola, me pasa lo mismo, has encontrado alguna solucion?

    • @grammor
      @grammor 3 месяца назад +1

      @@jcz8225 te voy a ser completamente honesto, no esta bien decir "has encontrado la solucion?" porque cuando queremos recibir una notificacion o ver un mensaje de respuesta es para esperar la respuesta o solución del problema se vuelve molesto recibir este tipo de mensajes

    • @niceone9805
      @niceone9805 Месяц назад

      @@grammor callate tonto xD

    • @BonnGamer257
      @BonnGamer257 Месяц назад

      @@grammor flaco esta preguntando si tuvo solución para saber si lo pueden ayudar también a el no rompas los huevos

  • @da_goose_gang
    @da_goose_gang 2 месяца назад +2

    may be a dumb question, but at 5:12 i litterally dont have the option to extract it, any idea what to do?

    • @yJoh_
      @yJoh_ 4 дня назад

      Download WinRar

  • @AdrielLoboz
    @AdrielLoboz 3 месяца назад +3

    Followed your tutorial step-by-step, ended up getting 178 errors... no clue what I did wrong

  • @sankeths3508
    @sankeths3508 2 года назад +4

    simple video which added great value, thanks very much sir

    • @iteducator
      @iteducator  2 года назад

      Thank you, You're welcome

    • @jcz8225
      @jcz8225 4 месяца назад

      @@iteducator tengo errores en el momento de usar javac y
      @jiocrestfall tambien

  • @goodbye9809
    @goodbye9809 Месяц назад

    The files extracted for class are slightly different than when extracted for java, when I open the class files and go to the one I want to edit, multiple files appear that are not in the java files, when I copy my java file into the class file and delete said class file for javac I get error "cannot find symbol". any help?

  • @Pelota480
    @Pelota480 8 месяцев назад +4

    When I tried using the javac part, I get a bunch of errors and cant generate .class

    • @leonardorosadossantos9876
      @leonardorosadossantos9876 8 месяцев назад +1

      same

    • @RoyLye
      @RoyLye 7 месяцев назад +2

      You probably need to add the classpath javac -cp

    • @ardaonuk2790
      @ardaonuk2790 6 месяцев назад

      @@RoyLye still got same error

    • @ardaonuk2790
      @ardaonuk2790 6 месяцев назад

      @@RoyLye got the same error. you meant the jar file for unpacked file?

    • @iteducator
      @iteducator  6 месяцев назад +2

      you need to keep all the dependencies as well used in the java file

  • @Bottle_of_airYT
    @Bottle_of_airYT Месяц назад

    I dont undertsand what you did when extractin ghr jar file, it doesnt work, im on windows 11

  • @googologyx
    @googologyx 7 месяцев назад +2

    I tried the javac command on a bunch of files in my Minecraft JAR file and it came back with a handful of errors

    • @ardaonuk2790
      @ardaonuk2790 6 месяцев назад

      did you fix it?

    • @googologyx
      @googologyx 6 месяцев назад

      @@ardaonuk2790 I did not

    • @iteducator
      @iteducator  6 месяцев назад

      You shoud keep all the dependencies as well used in the java file

    • @FreeCrazyIce
      @FreeCrazyIce 5 месяцев назад

      check if the jar file is a zip, if not, idk how to help with that

  • @DasherShortsYT
    @DasherShortsYT 3 месяца назад

    Issue when I try to recompile is it gives a bunch of errors about cannot finds symbol. Looking through replies, I don't understand what you mean by "make sure all dependencies are there."

  • @padlock2257
    @padlock2257 Год назад +1

    Hi i get error when compiling. without changing anything from the .java file

    • @iteducator
      @iteducator  Год назад

      please make sure all the imports are also present in the extracted folder

    • @ob0-china
      @ob0-china 11 месяцев назад

      @@iteducator do you mean that if the decompiled class file imports from other packages, i have to copy the packages into the same folder?

  • @justnormal2you455
    @justnormal2you455 2 года назад +2

    Thanks man, imma decompile a java phone game and modify shit, thansk again!

  • @yers7638
    @yers7638 2 года назад +1

    Nice i can decompile files but i dont know how to recompile them nice tutorial!

    • @iteducator
      @iteducator  2 года назад

      You can follow the tutorial, if there is any problem.

    • @埊
      @埊 Год назад

      @@iteducator which tutorial, it doesnt work too

  • @chrispharaoh4838
    @chrispharaoh4838 Год назад +1

    I liked your video very much it answered my question

  • @AD-je9nq
    @AD-je9nq 3 месяца назад

    Hello , this is such a great Video , thank YOU Very much for sharing , really appreciate it brother
    i had a quick question for you , my code is in in the jar ,but weird is its under a folder WEB-INF and Javac is giVing errors and not compiling
    it says package does not exist for WEB-INF ...what do we do now ? how can we compile ? please please help brother
    thank you
    Ajay

  • @mostdefinitelyahuman6875
    @mostdefinitelyahuman6875 3 месяца назад

    so I used javac, but it gave me an error saying "'javac' is not recognized as an internal or external command, operable program or batch file." Am I missing something?

    • @chaunceywei8430
      @chaunceywei8430 Месяц назад

      you need to add Environment Variables for JDK

  • @Red-ne
    @Red-ne Год назад +2

    getting bunch of erros when trying the javac command

    • @iteducator
      @iteducator  Год назад

      you have to place all the class files required for compilation

    • @askaine
      @askaine Год назад

      ​@@iteducator you mean if i changes multiple files i need to copy and paste them all and then do the javac command?

    • @iteducator
      @iteducator  Год назад

      yes all the imported classes and its dependent classes should be present as the compiler will use them.

  • @tonyfuentes9321
    @tonyfuentes9321 2 года назад +1

    Than you bro
    Question can you make a video explaining the obfuscated and de-obfuscated java files
    Please thank you

  • @oFaiOfficial
    @oFaiOfficial 4 месяца назад

    How do I Like Change a PNG There is one how do i replace it???

    • @iteducator
      @iteducator  4 месяца назад

      try winrar to add or delete, keep the same file name.

    • @oFaiOfficial
      @oFaiOfficial 4 месяца назад

      @@iteducator Oh I Actually Managed to do it a while ago But One Thing. so How do I Change it when Like the File Opens (Im Customizing a Minecraft Client) The Name of it is at the corner of the window how do I Change that?

  • @KarmaFight
    @KarmaFight 2 года назад +2

    Thanks a lot, It helped me a lot

  • @Elphoquito
    @Elphoquito Год назад

    cant return into .Class file i get error in cmd

    • @iteducator
      @iteducator  Год назад

      please make sure all the imports are also present in the extracted folder

  • @banglagaming007
    @banglagaming007 2 года назад +1

    When I am going to open a jar file through jd gui, it just doesn't open!!!
    What should I do now???

    • @iteducator
      @iteducator  2 года назад

      Extract the jar and then open any class file as a workaround, it does not happen usually unless something is wrong with the jar file.

  • @GokulRaj-iz3by
    @GokulRaj-iz3by Год назад

    Bro if re complied I getting error in the progam showing some is not available

    • @iteducator
      @iteducator  Год назад +1

      yes all the imported dependencies must be placed in the same paths as well to compile the code

    • @GokulRaj-iz3by
      @GokulRaj-iz3by Год назад +1

      @@iteducator your great . It works fine, thanks a lot. Please keep helping people. No words to say.

  • @ravikiranmutta1124
    @ravikiranmutta1124 Год назад

    its taking much time to convert source code for my respective jar file. more than 1 hr still not converted

    • @iteducator
      @iteducator  Год назад

      if the jar file is too large, it can be an issue, try doing it in parts

    • @ravikiranmutta1124
      @ravikiranmutta1124 Год назад

      Tqs for suggestions will try with that.

  • @rooverr
    @rooverr 4 месяца назад +1

    error: ')' or ',' expected
    }1L, 10L);
    ^
    how do I fix this ( this happened after I typed in the javac command )

    • @iteducator
      @iteducator  4 месяца назад

      check the java code in some editor, there seems to be a missing closing bracket

  • @tanvirremix
    @tanvirremix 6 месяцев назад +1

    success

  • @plamen-vw4bm
    @plamen-vw4bm 2 года назад +1

    it says java isnt recognized as an internal or external command, operable program or batch file

    • @iteducator
      @iteducator  2 года назад

      It's javac. And have you installed java in your system?

    • @plamen-vw4bm
      @plamen-vw4bm 2 года назад

      @@iteducator yes it works now but i get 112 errors when i try to compile it

    • @iteducator
      @iteducator  2 года назад +1

      You will have to resolve the programming errors. And make sure all the packages being used are present in the same paths as in the jar

    • @lawjz6927
      @lawjz6927 Год назад

      @@iteducator bro i installed java but i cant use javac command its jdk8 1.80 vers

    • @iteducator
      @iteducator  Год назад

      @@lawjz6927 check if java is installed properly, type java -version in the command line

  • @droidlycodes
    @droidlycodes Год назад

    Ran this and it runs a bunch of errors when compiling is there a method to avoid this?

    • @iteducator
      @iteducator  Год назад

      You must have all the dependency packages as well for it to compile

  • @dongwn13
    @dongwn13 2 года назад

    'javac' is not recognized as an internal or external command,
    operable program or batch file.
    How to resolve this??

    • @iteducator
      @iteducator  2 года назад

      You must have Java JDK installed.
      ruclips.net/video/i21CvFuDxek/видео.html

  • @bharathreddygajjala
    @bharathreddygajjala 11 месяцев назад

    How do I add other package references to compile. I have dependency on other jar/packages.

    • @iteducator
      @iteducator  9 месяцев назад

      keep them in the same folder as java files, and the entire folder structure should be the same as the JAR

  • @patricklee3735
    @patricklee3735 2 года назад

    saved my day! much appreciated!

  • @GooseAlarm
    @GooseAlarm 9 месяцев назад

    what if the file you want to edit is a .json?

    • @iteducator
      @iteducator  9 месяцев назад

      JSON can be edited as it is.

  • @music8d53
    @music8d53 2 года назад

    currently i don't switch from java to class using CMD . How to fix?

    • @iteducator
      @iteducator  2 года назад

      how can you switch in cmd? I don't understand your point

  • @MS-cn4dh
    @MS-cn4dh 2 года назад +6

    Hi.. I followed these steps but when I do javac filename.java in cmd, it gives me 5 errors. The errors are: cannot find Symbol (for class names). How to resolve this???

    • @iteducator
      @iteducator  2 года назад +1

      It occurs when you have the wrong keyword or identifier and the compiler cannot find it. Check out the exact line indicated, for a more detailed answer check out this thread.
      stackoverflow.com/questions/25706216/what-does-a-cannot-find-symbol-or-cannot-resolve-symbol-error-mean

    • @Firesealb99
      @Firesealb99 2 года назад +1

      I had to use the -classpath modifier to include the folders that had the Classes in them.

    • @MS-cn4dh
      @MS-cn4dh 2 года назад +1

      Hi all.. I made it work later on.. will share soon if I remember what I did.. thanks to this tutorial for help!😊

    • @brucergb
      @brucergb 2 года назад +1

      @@Firesealb99 works for me, but additionally I download additional missing dependencies

    • @ob0-china
      @ob0-china 11 месяцев назад

      @@MS-cn4dh hey, could you share what you did please?

  • @manjeetcscmahisaur4848
    @manjeetcscmahisaur4848 Год назад

    Sir me java file me convart kar le raha hua lekin mai class file me nahi ho paa raha hai

  • @walidpw9358
    @walidpw9358 Год назад

    please any one can help me with this error : javac acceuil.java
    acceuil.java:3873: error: variable declaration not allowed here
    boolean bool = (new File("Dossier_photos")).mkdirs();
    ^
    1 error
    all the fille are in the same folder, thank you

    • @iteducator
      @iteducator  Год назад

      check if it's already declared

  • @Tymek7123
    @Tymek7123 Год назад

    Im lost in the cmd, there is no in my this file name

    • @iteducator
      @iteducator  Год назад

      what is not there in the cmd?

  • @georgekoletsis3276
    @georgekoletsis3276 2 года назад

    Hello! At the step "Save all sources" the save process is taking too long and it is not finally successfully saved as zip. Could you help me please?

    • @iteducator
      @iteducator  2 года назад

      the time depends on the size of the file, if it is a large file try to extract and do it in parts, also make sure you have java installed properly. Check this video to see:
      ruclips.net/video/i21CvFuDxek/видео.html
      Are you getting any errors as well?

    • @georgekoletsis3276
      @georgekoletsis3276 2 года назад

      @@iteducator Hello again, I use Java 11 for my project. It has been installed properly for sure. I have extracted in parts as you suggested and it is working for some classes. The size of my jar is 6.88MB. Let me know if you have any other solution in order to extract the whole jar! Many thanks again :)

    • @vincentdevanc
      @vincentdevanc Год назад

      @@georgekoletsis3276 use jd 1.4.2 or older versions bro

    • @itzmeee4
      @itzmeee4 Год назад

      I used versiom 1.4.2 and it soved mine

  • @AqwsSuper
    @AqwsSuper Год назад

    The javac command brings me errors because some of the variables and functions in the .class file are being called by other parts of the .jar file, so anytime I try to use the javac command on the one specific .class file I made changes to, it'll come up with errors saying that certain functions and variables and symbols aren't defined/recognized (because they come from other parts of the .jar), this is the only part I'm having trouble in, is there any way to convert this .java file into a .class? I've been stuck on trying to do this last part for a while

    • @iteducator
      @iteducator  Год назад +3

      you need to place all the dependencies packages and classes in the same paths as the java file in order to compile

    • @AverageSchizo
      @AverageSchizo 10 месяцев назад +1

      @@iteducator what does that even meannnn
      what is a dependency package, you didn't cover that at all in the video?

    • @iteducator
      @iteducator  10 месяцев назад

      @@AverageSchizo it's basic programming, and as the name suggests dependency, which means the package of code that your program is dependent on. In Java these are the imported packages in start of the code file.

    • @Roz_ggez
      @Roz_ggez 9 месяцев назад

      Bro did u get any solution? I got the same problem too

    • @generalpashon
      @generalpashon 8 месяцев назад +1

      @@Roz_ggez put the .java file in root of unpacked archive and call the javac command here

  • @ペルマナの家族
    @ペルマナの家族 2 года назад +1

    its work thankyou very much

    • @iteducator
      @iteducator  2 года назад

      You're welcome! Glad you found it helpful

  • @naveenkumar1999
    @naveenkumar1999 2 года назад

    Hey, I'm getting a package not found error while trying to compile using 'javac'. What should I do?

    • @iteducator
      @iteducator  2 года назад

      You must include it for it to compile

    • @naveenkumar1999
      @naveenkumar1999 2 года назад

      @@iteducator I have all those packages included.

    • @iteducator
      @iteducator  2 года назад +1

      stackoverflow.com/questions/3041543/package-not-found-javac
      Try this

    • @naveenkumar1999
      @naveenkumar1999 2 года назад +1

      @@iteducator okay thanks, I'll try that

  • @NguyenChang-qn8uz
    @NguyenChang-qn8uz Год назад +1

    OMG thank you sir very muchhhh

  • @Aru8675
    @Aru8675 2 года назад +5

    Bro i don't understand anything clearly please make another video how to convert jar files into Java and then edit with the example of any game or app

    • @iteducator
      @iteducator  2 года назад +2

      Please watch it again, all the steps are there.

    • @jurgenoerlemans1
      @jurgenoerlemans1 Год назад

      I had some difficulties too whwn I watched it the first time , but you have to really watch carefully. All steps are shown. I made some notes with pen and paper to 'educate myself :-) . It helps . .'

    • @hambernat6444
      @hambernat6444 8 месяцев назад

      This tutorial is stupid, guy is clicking random stuff, swinging mouse right and left and doing things calling "these" in the same time moving mouse randomly...

  • @mystic837
    @mystic837 Год назад

    When save all source . It run 50%. Why bro?

    • @iteducator
      @iteducator  Год назад

      Is your file too large? if yes, then try it in parts by extracting

  • @jurgenoerlemans1
    @jurgenoerlemans1 Год назад

    great explanation. But . . my issue is that when I want to compile the changed Java file, i get an error on the package name, which starts with
    package WEB-INF.string1.string2.string3
    It is the '-' between WEB and INF that is not allowed. However; I didn't invent the WEB-INF: It was already in the source file (which is a working application. Anybody any ideas?

    • @iteducator
      @iteducator  Год назад

      Can you share the error you're getting, and have you placed the WEB-INF in the exact path

    • @peony_si_ibrahimkayyis6050
      @peony_si_ibrahimkayyis6050 Год назад

      @@iteducator i also get the same error

  • @mrakobes6888
    @mrakobes6888 6 месяцев назад +1

    THAAAAANKS!

  • @anulagrawal5300
    @anulagrawal5300 2 года назад

    Will this work for EAR also ?

  • @埊
    @埊 Год назад

    what if my java file has 5 classes, 3 of which are needed to be edited[these are not taking much space in notepad], will the decompilation et compilation break anything?
    and is the java file and executable jar file the same thing?

    • @iteducator
      @iteducator  Год назад

      It won't cause an exception if there are no errors. JAR file and java file are different things.

  • @user-hq4ep7ys2t
    @user-hq4ep7ys2t 2 года назад

    how to install java compiler?

    • @iteducator
      @iteducator  2 года назад

      you have to install Java Development Kit (JDK) for windows

    • @user-hq4ep7ys2t
      @user-hq4ep7ys2t 2 года назад +1

      @@iteducator ik, its old java i already fixed

  • @Valyk027
    @Valyk027 2 года назад +1

    Thanks

  • @leno_tc_1
    @leno_tc_1 2 года назад

    thank you very much :)

  • @7pro455
    @7pro455 Год назад +1

    My like is number @300@❤️❤️

  • @PassaggioTecnologia
    @PassaggioTecnologia 4 месяца назад +1

    top

  • @worldnewsvideos
    @worldnewsvideos 2 года назад

    ❣👍👍👍👍👍👍👍👍👍

  • @sureshkumar-pc7qo
    @sureshkumar-pc7qo 2 года назад +1

    thank u very much :)