tonikelope / megabasterd

Yet another unofficial (and ugly) cross-platform MEGA downloader/uploader/streaming suite.
GNU General Public License v3.0
4.53k stars 595 forks source link

Jun 19, 2023 10:14:44 PM com.tonikelope.megabasterd.SqliteSingleton getConn. on Macbook M1 #544

Open xmonfort opened 1 year ago

xmonfort commented 1 year ago

when I try to run Megabaster on Macbook with Mac OS 13 (Ventura) I get this result:

sudo java -jar ./jar/MegaBasterd.jar Jun 19, 2023 10:14:44 PM com.tonikelope.megabasterd.SqliteSingleton getConn SEVERE: Error opening connection Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.sql.Connection.createStatement()" because "conn" is null at com.tonikelope.megabasterd.DBTools.setupSqliteTables(DBTools.java:33) at com.tonikelope.megabasterd.MainPanel.(MainPanel.java:258) at com.tonikelope.megabasterd.MainPanel.main(MainPanel.java:136)

And the programa crashes and doesn't run.

best wishes.

ehte92 commented 1 year ago

Getting the same issue for me as well.

sparkirat commented 1 year ago

I had the same issue and this fixed it for me:

  1. First Right click on the folder where u have downloaded the Megabasterd zip file.
  2. Then Click on open a new terminal tab at folder.
  3. Lastly Paste in this command: ./jre/bin/java -jar ./jar/MegaBasterd.jar

If that still doesn't work uninstall it and download the zip and try to use it again

jsanta commented 1 year ago

Worked for me using Java 8 from adoptopenjdk-8.jdk. brew install --cask adoptopenjdk/openjdk/adoptopenjdk8

Had to specify the Java path in order to use this specific version. Something like:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
$JAVA_HOME/bin/java -jar MegaBasterd_7.74.jar
Tejoshmoy commented 1 year ago

Screenshot 2023-07-27 at 7 24 27 AM Incase anyone is trying to do this on Mac (Ventura)… this is what you need to do:

  1. Open terminal and use the terminal command: sudo spctl --master-disable
  2. Restart your mac. (this will enable app-installation from un-identified sources)
  3. Then Download the latest version and unzip it
  4. Open a terminal window in the "unzipped folder". MAKE SURE IT'S IN THE UNZIPPED FOLDER… or alternatively, just simply move to the directory of the "unzipped folder"
  5. Follow the README.txt file and type the two consecutive commands: a. chmod +x MegaBasterd.run b. ./MegaBasterd.run
  6. It should work… but if not… then: a. Go to "System Settings" and then to "Privacy and Security" and allow the unidentified app b. go back to the terminal window with the right directory opened and re-type the command: /MegaBasterd.run
  7. Put password / Allow it to run

If it still doesn't work, try this:

  1. Open terminal
  2. Use these two commands: a. brew install --cask adoptopenjdk/openjdk/adoptopenjdk8 b. export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home $JAVA_HOME/bin/java -jar MegaBasterd_7.74.jar ………then wait for 5-10 minutes for it to download and install… (Hopefully you have HomeBrew installed and have previously integrated GitHub with Terminal already)
  3. Repeat Step 4 onwards……

Play around with these information and it should work. If not… then good luck on your quest, my pirate soldier!

jomp16 commented 10 months ago

Since running the MegaBasterd.jar causes the first error about getConn,

I investigated it, and found that all that's required to make it run was only upgrade the SQLite library to the latest version that has support for Apple Silicon.

The current version being used is 3.25.2, from 2018, aka, before Apple Silicon release.

The dependency org.xerial:sqlite-jdbc should be upgraded to a later version, dunno which was the initial version with Apple Silicon support, but I've rebuilt it using 3.43.0.0 and it works fine.