Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code now broken for Java8 #600

Closed
kaufmand opened this issue Oct 30, 2023 · 2 comments
Closed

Code now broken for Java8 #600

kaufmand opened this issue Oct 30, 2023 · 2 comments

Comments

@kaufmand
Copy link

The last version that worked for Java8 was 8.5. Since then an exception is thrown when trying to download with a folder URL, with the Debug log showing:
Exception in thread "pool-1-thread-12" java.lang.NoSuchMethodError: java.nio.file.Path.of(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;
at com.tonikelope.megabasterd.MegaAPI.writeCachedFolderNodes(MegaAPI.java:1081)
at com.tonikelope.megabasterd.MegaAPI.getFolderNodes(MegaAPI.java:1106)
at com.tonikelope.megabasterd.FolderLinkDialog._loadMegaDirTree(FolderLinkDialog.java:465)
at com.tonikelope.megabasterd.FolderLinkDialog.lambda$new$4(FolderLinkDialog.java:103)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Path.of was not introduced until Java11. Could you use instead Paths.get, which would be compatible with Java 8? I am using the latest version of Oracle Java 8. Thanks.

tonikelope pushed a commit that referenced this issue Oct 30, 2023
Trying to keep Java 8 compatibility #600
@kaufmand
Copy link
Author

Thanks for fixing the Java8 problem with Path.of. This exposed another incompatibility with Java8. File.writeString was also introduced in Java11 and is incompatible with Java8. It looks like that is used once in MegaAPI.java. Could you use instead File.write, which would be compatible? Thanks. Here is the latest from the Debug log.

Exception in thread "pool-1-thread-11" java.lang.NoSuchMethodError: java.nio.file.Files.writeString(Ljava/nio/file/Path;Ljava/lang/CharSequence;[Ljava/nio/file/OpenOption;)Ljava/nio/file/Path;
at com.tonikelope.megabasterd.MegaAPI.writeCachedFolderNodes(MegaAPI.java:1080)
at com.tonikelope.megabasterd.MegaAPI.getFolderNodes(MegaAPI.java:1105)
at com.tonikelope.megabasterd.FolderLinkDialog._loadMegaDirTree(FolderLinkDialog.java:465)
at com.tonikelope.megabasterd.FolderLinkDialog.lambda$new$4(FolderLinkDialog.java:103)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

tonikelope pushed a commit that referenced this issue Oct 30, 2023
#600 

Fix pre-pro bar
@kaufmand
Copy link
Author

Thanks for fixing this so promptly. Version 8.13 is working for me in Java 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants