CompEvol / beast2

Bayesian Evolutionary Analysis by Sampling Trees
www.beast2.org
GNU Lesser General Public License v2.1
240 stars 84 forks source link

BEAST apps don't launch on Windows 10 #1137

Closed ms609 closed 10 months ago

ms609 commented 10 months ago

Related: #829 , https://groups.google.com/g/beast-users/c/Vbg3G224ypM

I have followed the instructions at https://www.beast2.org/ to download BEAST 2.7.6 for Windows 10.0.19045 Build 19045. My machine already had Oracle and Azul JDKs installed at version 19.

I unzipped the BEAST directory to my local path. On double-clicking BEAUTi.exe or BEAST.exe, I first see the "unrecognized app" warning; after granting permission, nothing happens. Launching the app again no longer displays the warning; now nothing happens at all.

I tried uninstalling JDK 19 and installing JDK21 from https://www.oracle.com/java/technologies/downloads/

In a cmd terminal, I now see

>java -version
java 21.0.2 2024-01-16 LTS
Java(TM) SE Runtime Environment (build 21.0.2+13-LTS-58)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.2+13-LTS-58, mixed mode, sharing)

>.\bat\BEAUTi.bat
java.lang.ClassNotFoundException: beastfx.app.beauti.Beauti
        at java.base/java.net.URLClassLoader.findClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Unknown Source)
        at beast.pkgmgmt.BEASTClassLoader.forName(Unknown Source)
        at beast.pkgmgmt.launcher.BeastLauncher.run(Unknown Source)
        at beast.pkgmgmt.launcher.BeautiLauncher.main(Unknown Source)

I have tried deleting the jre folder in the BEAST directory (well, renaming it, actually), to avoid any potential conflict; I then see

>.\bat\BEAUTi.bat
java.lang.ClassNotFoundException: beastfx.app.beauti.Beauti
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:495)
        at java.base/java.lang.Class.forName(Class.java:474)
        at beast.pkgmgmt.BEASTClassLoader.forName(Unknown Source)
        at beast.pkgmgmt.launcher.BeastLauncher.run(Unknown Source)
        at beast.pkgmgmt.launcher.BeautiLauncher.main(Unknown Source)

I have tried installing JRE 8 from https://java.com/ per the README, and uninstalling it again; this seems to make no difference; I've also tried uninstalling all local JDK instances, and installing just JDK17 to match(?) the JDK version bundled with BEAST, to no avail. DensiTree.exe launches correctly, as does a previous install of BEAST 1.10.4.

I'm hoping to use BEAST2 for teaching next week, so even if it's tricky to get to the root of the problem, am hoping that this is an issue particular to my machine rather than one that students are likely to encounter in class. Any suggestions would be gratefully received.

rbouckaert commented 10 months ago

@ms609 A jre is included with the BEAST distribution, and the exe files are set up to pick up that jre. Any other jre installed should be ignored by BEAST.

Renaming the jre folder makes that the exe file cannot find the jre included with BEAST, and the default jre is used. This is not recommended, since BEAST relies on JavaFX without using modules, and several jre specific hoops need to be sprung to make that work.

I am curious to what the problem can be, so perhaps you can provide the following information: Does .\bat\BEAST.bat -version give any output? Which folder did you install BEAST? The package folder should be in C:\Users\<yourname>\BEAST where <yourname> is your user name. Does that folder exists? Does it contain a 2.7 subdirectory, with BEAST.app and BEAST.base inside?

ms609 commented 10 months ago

Hi @rbouckaert , thanks for picking this up. I've restored the jre folder.

Answers below:

Does .\bat\BEAST.bat -version give any output?

.\bat\BEAST.bat -version
java.lang.ClassNotFoundException: beastfx.app.beast.BeastMain
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at beast.pkgmgmt.BEASTClassLoader.forName(Unknown Source)
at beast.pkgmgmt.launcher.BeastLauncher.run(Unknown Source)
at beast.pkgmgmt.launcher.BeastLauncher.main(Unknown Source)

Which folder did you install BEAST?

C:\Programs\Phylogeny\BEAST

The package folder should be in C:\Users\<yourname>\BEAST where <yourname> is your user name. Does that folder exists? Does it contain a 2.7 subdirectory, with BEAST.app and BEAST.base inside?

Yes

I wonder whether it's relevant that I once built BEAST from source, elsewhere on the machine. I hadn't thought that this would overlap with a clean install of BEAST, but perhaps if they are both looking in a common folder in my Users directory there might be some interaction..?

ms609 commented 10 months ago

Ahha! I deleted the C:\Users\<yourname>\BEAST folder and BEAST launched successfully. There must have been a conflict with the preexisting files. Thanks very much for the pointer!

rbouckaert commented 10 months ago

@ms609 glad to see the starting problem is solved. Please, do report problems you observe when teaching.