Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8068695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:46:25+00:00 2026-06-05T12:46:25+00:00

I started off with a .jar file that I unzipped. I need to change

  • 0

I started off with a .jar file that I unzipped. I need to change a few lines of code in just ONE of the classes contained in the contents of that jar file. I went about this as follows:

1) opened the class in Java Decompiler to view the source.

2) copied source to a new text file and saved with “.java” extension.

3) in command line I went to jdk folder and executed javac Classname.java to recompile.

However this class code imports some dependencies so the recompile failed. I have the dependencies, they were part of the original jar file contents but they are all compiled .class files and spread across several folders…

Is it possible to re-compile this class successfully? Is there command line code to include dependencies?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:46:27+00:00Added an answer on June 5, 2026 at 12:46 pm

    Yes, use the -classpath option.

    javac -classpath original.jar Modified.java
    

    Then, you can remove the old class from the jar file and insert the new one. There isn’t a simple way to do this via command line, so I recommend an archive application such as WinRAR or 7-zip.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine a 5 MB jar file that contains many main classes, each of which
Here's the code I started off with: long modifiedTime = [some time here]; File
I just started off with OpenMP using C++. My serial code in C++ looks
I created two applications that were essentially identical on heroku. They started off different
I'm started off developing a facebook application. One of the requirements is to have
I'm doing a home project that started off really easy (doesn't that always happen?)
I am currently using jQuery to write an online application, that started off with
I started off with Xalan for C++, but that really seemed like overkill for
I've just started building my own rest webservice and I started off by going
Just learning rails, am on to migrations and it all started off pretty logically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.