1

I have version 1 and version 2 of a Java-based software product. And I have access to the .JAR files and .class files.

(Note: Java customization is a legitimate technique for configuring the product. We don’t need to worry about breaking any rules when looking at the JAR files.)

I interact with the Java classes via automation scripts. I use the Jython 2.7 programming language to write Python scripts that utilize the product's Java API.


I'm aware that new Java methods have been added in version 2 that were not in version 1.

When writing my Jython scripts, it would be helpful to have a complete list of new Java methods that were added between versions. Unfortunately, a "list of new Java methods" is not included in the documentation.

Question:

In Eclipse, is there a way to compare a list of Java methods between two JAR directories/projects -- that could be used to identify Java methods that are in one, but not the other?

User1974
  • 276
  • 1
  • 17
  • 63
  • 1
    What have you tried so far? Do you have an example of your scripts? – LMC Aug 03 '21 at 16:44
  • 4
    You can use for each of both versions _Search > Search...: Java Search_ to get a list of all method declarations in the _Search_ view, which you can then copy into a text file to compare them textually. – howlger Aug 03 '21 at 19:31
  • @howlger Would you have any interest in posting your comment as an answer? Or should I? – User1974 Oct 20 '21 at 13:22
  • Are you comfortable with a command line tool such as jardiff? Kinda looks like this comes w/Ubuntu. https://manpages.ubuntu.com/manpages/focal/man1/jardiff.1.html – unigeek Oct 20 '21 at 17:22
  • 1
    You can actually compare the jars using any comparison tool like Beyond Compare with a class comparison helper. Or just add the two jars in your classpath, open the required files from both the jars in Eclipse, copy the contents and compare them using any comparison tool. – Rohan Bhattacharya Oct 21 '21 at 07:42

1 Answers1

1

You can use for each of both versions Search > Search...: Java Search to get a list of all method declarations in the Search view, which you can then copy into a text file to compare them textually: in the Project Explorer or Package Explorer, select both files, right-click and choose Compare With > Each Other.

With the AnyEdit Tools plugin no files need to be created: copy the first search result into an Untitled Text File (File > New > Untitled Text File), select all (Ctrl+A) copy the second result and in the Untitled Text File right-click and choose Compare With > Clipboard.

howlger
  • 31,050
  • 11
  • 59
  • 99