We are using aspose-words-java-for-ruby and we recently updated the version of the .jar file from 17.7-jdk-16 to 19.11-jdk-17 which seems to break Java functionality on Mac.
Whenever Aspose is initialized, it’s triggering a pop-up saying “to run this Java application, you must install the legacy Java SE 6 Runtime”. That particular version of Java is outdated and MacOS will not let you install it. We spent a day or two looking for workarounds to no avail.
Strangely, it seems to completely remove Aspose’s
.replace method which is what we use to actually replace all the document variables in the feature that’s dependent on Aspose. That method is still listed in the documentation so we’re not sure why this happens.
We would appreciate any help regarding this.
We suggest you please use the latest version of Aspose.Words for Java 20.2 and upgrade your Java version. We removed the obsolete Replace methods from Range class. Please read the following article and update your code according to latest APIs.
Find and Replace
Thanks for the suggestion - we have upgraded to the latest version of Aspose Words for Java 20.2 and tried jdk-16 and jdk-17 but we are still getting the prompt for installing JAVA SE6 runtime environment and also getting error with the
.replace method. We are working on MacOS Catalina 10.15.3.
We are using asposewordsforjavaruby and we followed the documentation for ruby - Find And Replace in Ruby|Aspose.Words for Java which has last been updated in May 2016. Do we need to change anything with how we are using the
.replace method in ruby? Since you said the
.replace method has become obsolete, what should we use instead?
We will check this case at our end and will update you about our findings soon.
We will update the article according to latest API and inform you via this forum thread.
Please use the latest method of Range.Replace. Please find the detail from here:
Could you please share the JDK version that you are using at your end? Thanks for your cooperation.
This is the java version we are using locally -
Screen Shot 2020-03-09 at 12.20.36 PM.png (39.3 KB)
We were able to fix the prompt for installing JAVA SE6 runtime by the following way:
Screen Shot 2020-03-06 at 4.39.14 PM.png (40.3 KB)
Reason for this prompt was -
“By default JDK from oracle only enabled the
CommandLine capability but this library (Rjb) needed JNI and possibly more capabilities because of which macOs was suggesting me to install the old version of the Java from Apple which had those capabilities enabled by default.”
However, we would love it if you could provide us with the updated documentation for Find And Replace in Ruby|Aspose.Words for Java
It is nice to hear from you that your problem has been solved. We will update the article and inform you soon.