0

I have an application that is developed in Java that has nice GUI and all. I don't have the source code and also the dll's of that. But I have the compiled classes of that application (.jar files).

Now, I want to automate that application. I mean the application needs manual intervention.

Can I use that compiled classes so that I can use its functions to automate the functionality of that application?

If so, how would this be done?

3
  • Very similar question posted 7 hours ago: stackoverflow.com/questions/11516905/… Commented Jul 17, 2012 at 13:49
  • Your question is very unclear. You have an executable jar of a Java program, OK. What is it that you want to accomplish? What do you mean by "the application needs manual intervention"? How do you intend on automating an application that needs "manual intervention"? Commented Jul 17, 2012 at 13:49
  • Yes, you can use the jar the same way you would use any other .jar library. You just put it on your class path, and you're good to go. The steps to add it to your project will vary based on your environment. Commented Jul 17, 2012 at 13:51

3 Answers 3

2

You shouldn't have to "got the compiled classes out of that application (.jar)". A better idea would be to treat it just like any other 3rd party JAR and add it to your CLASSPATH when you compile and run.

You'll write your own class that instantiates an instance of that 3rd party class and calls its methods, just like any class you get from the JDK.

You may not be able to alter that class; you might not want to even if you could.

If you must have new functionality, the OO way would suggest that you should extend that class, if you can, and override its method according to your needs.

Sign up to request clarification or add additional context in comments.

Comments

1

Put that .jar into your classpath and use what ever you want from that application. If you need to use private fields or methods also you can use Reflection API for that. There is no restrictions of using objects from .jar file.

Comments

0

You should beware of infringing on any copyrights if the application you are referring to is proprietary. Otherwise, any java decompiler will get you the source code from those class files.

2 Comments

I would not recommend decompiling anything. There should not be any need to do so.
Yeah I think I mis-understood the question

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.