Basically I have a Jar file capable of parsing Java files and do some calculations based on the parsed values.
The problem is that the grammar in this Jar is old and only supports version 1.5 of Java. I looked around and found a grammar released by the same company that supports Java version 1.8, so I want to update the Jar file with the two updated files needed by the application.
Analysing the Jar file with JD-GUI, I can see that this is the location of the two files that I want to update:
JarDir/foo/bar/Java.g
JarDir/foo/bar/JavaTreeParser.g
First, I followed this suggestion and tried using 7-zip to edit both files. I basically opened the Jar file with 7-zip, found the files and edited their content. After trying the "updated" Jar, it seems to work just like before updating it. For example it still can't parse this ArrayList<String> s = new ArrayList<>();
since the diamond operator is a Java 7 addition.
Now I was thinking about using jar uf
like this answer suggests, but I don't know how to specify the path of the that I want to insert in the Jar.
Can anyone give me a hand with this?