• 0

How do i edit a .class file and add it back into a .jar?


Question

Hey all,

I have a program in java that was made a while ago for me but my coder has gone awol. i need to be able to change a line in one of the .class files which is located within the .jar then i need to add it back into the .jar in order to run the program successfully.

I can extract the files using winrar and then edit the class file in notepad but a lot of the text is garbled. I have then tried creating an archive with the extension .jar instead of .rar but it wont work like that.

Does anybody know the best way to do this?

Thanks in advance

10 answers to this question

Recommended Posts

  • 0

hmm i have no idea whatsoever what i am doing with this program :s is there an easier program that will do it?

  divinatum said:
Jar files are zip files, rename to zip, extract, modify class, zip up, rename to .jar, should be good to go.

Hi and thanks for your reply. what should i edit the class with?

  • 0

Thanks monkey i was able to edit the class file with that program but now i am having troubles creating the .jar.

I am using winrar to create the archive and simply giving the extension of .jar but when i try to run it with cmd i get corrupt archive message

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I've set since XP - Best performance in the Performance settings. 11 included. I enable only the show shadows after that, so I can see better fonts and mouse.. But hardly I can say I can see a difference today.
    • Yeah this kinda means nothing to me if it's going to be the same mess as HDMI 2.1 where it was difficult to know what features you were getting. It was way too confusing, designed to fool us into thinking we was getting something better with the higher number when a lot of the times we didn't get anything better because companies can add and remove features at will, which if that is the case for 2.2, then who cares lol.
    • Someone wrote a script to block 'brainrot' content online using an $8 smart plug by Usama Jawad Original image via Neil Chen Many people use smart plugs nowadays due to the various advantages they offer, including automation, integration with mobile software, increased home security, better energy efficiency, and compatibility with other smart products. However, a smart plug customer has gone a step further by enhancing their hardware in a way that it blocks them from viewing "brainrot" content online, or any website, for that matter. As seen in a popular thread over on Hacker News, a person known as "NWChen" has written a script that connects to the $8 Kasa Smart Wi-Fi Plug Mini and utilizes it to restrict access to websites of your choice. In essence, this plug then acts as a physical switch that you can toggle to visit certain websites. NWChen's main motivation behind this initiative was to avoid brainrot, with examples listed as X (formerly known as Twitter), Instagram, YouTube, and Reddit in their blog post. In terms of technical functionality, the smart plug connects to Wi-Fi (obviously) and hosts a physical switch that can be used to turn it on and off. NWChen's script connects to the smart plug via an API and then polls its state. If it's on, websites of your choice get restricted and you can't open them anymore, until you physically get up and turn off the plug, or remove the website from you blocklist. NWChen has recommended plugging in the hardware far away from you so there is sufficient resistance in turning off the plug. In the thread, many have praised this invention, believing that the nature of this mechanism provides enough hurdles where you'd rather just not visit the problematic websites anymore. However, some have noted that "those without self control cannot be trusted if they hold the switch". Some have also highlighted a problem where a user can simply stop the script's execution without much friction. Overall, it's a fairly interesting setup, even if it's fairly rudimentary in nature. Configuring this physical block with a Kasa smart plug is fairly easy. You can simply download the script from the laptop-brick GitHub project here, install it, get the IP address of your smart plug, and then use it when you're executing the script. You can modify the blocklist using a dedicated file present inside the GitHub project.
    • We'll probably mirror the EU rule, we've done that in many other areas, but if we don't, well we can add this as another reason why Brexit shouldn't have happened. Personally, if I started to get ads in WhatsApp, that would be a big incentive for me to want to switch to an alternative, and I doubt it will be difficult for me to get my contacts to change as well.
    • It reminds me of fossil fuels, as they try to push the price up and renewable energy continues to get better and cheaper, it's putting the squeeze on the fossil fuel industry. In this case, bringing jobs back to modern countries with higher wages would be a big incentive for corporations to remove humans from the workforce and replace them with AI and robotics, and the funny thing is about that, consumers will demand it because they want things cheaper not more expensive, also corporations will be forced to do it if they want to survive against others that go that route. At the end of the day, they didn't pick cheap labour because they wanted to do so, they did so because competition forced companies to do so, bringing jobs back to western countries would make these companies less competitive on the world stage, unless they use a lot more AI and robotics to remove a lot of humans from the workforce. With that said, bringing jobs back to more stable regions and using AI and robotics does have the benefit of reducing the risk of political trade wars and tariffs, but let's forget this idea of jobs coming back home to higher paying wages, that idea is dead in the water with the advancement of AI and robotics, and with humans, it would only end up making a lot more things more expensive.
  • Recent Achievements

    • One Month Later
      Miguel Batista earned a badge
      One Month Later
    • Dedicated
      moojay67 earned a badge
      Dedicated
    • Week One Done
      urbanmopdubai1 earned a badge
      Week One Done
    • One Month Later
      Jim Dugan earned a badge
      One Month Later
    • First Post
      Johnny Mrkvička earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      654
    2. 2
      Michael Scrip
      230
    3. 3
      ATLien_0
      220
    4. 4
      Steven P.
      151
    5. 5
      Xenon
      145
  • Tell a friend

    Love Neowin? Tell a friend!