Page 1 of 1
Filebot not launching (Error: Could not find or load main class)
Posted: 18 Feb 2022, 10:23
by nimefol684
I can't seem to be able to launch filebot. Every time I launch it nothing happens. I've tried reinstalling it (multiple times), installing java 8, updating windows, rebooting my pc, installing the beta versions, installing older versions, running the platform shortcut of filebot. When I run it in a Virtual Machine (VMware) with windows 10 it runs perfectly fine. Even the command line filebot works on the VM.
But when I try to run the command line filebot on my pc it says:
Error: Could not find or load main class
Caused by: java.lang.ClassNotFoundException
I also checked process explorer and saw that it shows as a process for a second or two and instantly closes.
I've been trying to fix this for a few days now. Any help would be appreciated!
Re: Filebot not launching
Posted: 18 Feb 2022, 10:58
by rednoah
How did you install FileBot? Have you tried the MSI package and the ZIP package? Perhaps one will work when other doesn't:
https://www.filebot.net/download.html
This error message is most unusual. It would indicate that the application code is missing or inaccessible, but since missing files shouldn't be possible, my next best guess is some interference, e.g. anti-virus blocking filebot from reading it's own application files:
Code: Select all
Error: Could not find or load main class
Caused by: java.lang.ClassNotFoundException

Since you have a VM where everything is working, and a machine where it doesn't work. You could try some systematic testing to see if you could narrow down some key difference, e.g. some anti-virus software being installed or not, some environment variables being set or not, etc.
Re: Filebot not launching (Error: Could not find or load main class)
Posted: 18 Feb 2022, 11:34
by nimefol684
The virtual machine has no antiviurus. It runs on Windows LTSC. My main pc has an antivirus, Avira. I also tried the zip version you mentioned but no luck (extracted the zip in a folder first and ran it). I had avira turned off before running the zip version, and also while running the msi installer. Tried running the version of filebot installed using the .msi file with AV turned off, again no luck. I've also tried the command line version which shows the same error (AV turned off, too). Could it be caused by having files in other languages? I have both a Macedonian and English on my pc, but i don't believe that's the problem.
I'm running Filebot v4.9.4, if that's important.
Re: Filebot not launching (Error: Could not find or load main class)
Posted: 18 Feb 2022, 11:39
by nimefol684
Also wanted to mention that I tried looking at a list of programs on the VM. I have the same programs on my pc too. The VM has Java 8 321, so does my pc. I even tried checking if the VM and PC have the same Microsoft Visual C++ versions, they do (with revo uninstaller pro). Should mention that my pc has the following specs:
Code: Select all
Device name DESKTOP-S2P1QNV
Processor AMD Ryzen 3 2200G with Radeon Vega Graphics 3.50 GHz
Installed RAM 8,00 GB
Device ID 1797FD3A-0F68-41BD-9547-A12715CC0806
Product ID 00330-80000-00000-AA577
System type 64-bit operating system, x64-based processor
Pen and touch No pen or touch input is available for this display
Edition Windows 10 Pro
Version 21H2
Installed on 04.1.2021
OS build 19044.1566
Experience Windows Feature Experience Pack 120.2212.4170.0
Re: Filebot not launching (Error: Could not find or load main class)
Posted: 18 Feb 2022, 11:43
by rednoah
nimefol684 wrote: ↑18 Feb 2022, 11:34
I have both a Macedonian and English on my pc, but i don't believe that's the problem.
It'd be strange, but anything is possible. There certainly aren't a lot of users who've tested things on Macedonian locale. Windows LTSC is also untested.

I'd start with a pristine VM, ensure FileBot works, and then install all the things, all the configurations, that you usually do on your host, and try FileBot after every step, so that perhaps you can narrow down the one step / software / system configuration / etc that makes FileBot not work.

Note that FileBot doesn't use the JDK that is installed on the system, so installing JDK8 shouldn't do anything, but if it did, then it wouldn't work
(though with a very different error message) because FileBot requires the latest JDK.

Did you make sure that you don't have any strange environment variables lurking around? e.g. custom JVM options configured via
JAVA_OPTS and friends that FileBot might pick up on?
Re: Filebot not launching (Error: Could not find or load main class)
Posted: 18 Feb 2022, 18:18
by nimefol684
Java SE Development Kit 8 Update 321 (64-bit) is installed on my main machine, but not on the VM. Yet it works on the VM, not on my main machine.
Out of curiosity I tried running the filebot command again in CMD and got a bit of a different result:
Code: Select all
Error: Could not find or load main class D:\Skolo\2021-2022\?????\???????
Caused by: java.lang.ClassNotFoundException: D:\Skolo\2021-2022\?????\???????
D:\Skolo (translates to: School) is where I keep all of my school work, so a bit odd that Filebot is swearing at it. The files with question marks are in Macedonian (Cyrillic). I tried renaming all the files that are in cyrillic to english, but to no avail.
I also tried copying all the files from the Filebot directory on my host to the VM and running them in the VM. It worked in the VM, not on my host machine; on my host it just dissapears from the process explorer after a second.
Before making this post I also made sure to search it up using multiple search engines, these are the results I got:
viewtopic.php?t=6039
viewtopic.php?t=4018
With a quick google search I also found out that the java.lang.ClassNotFoundException is a checked exception in Java that occurs when the JVM tries to load a particular class but does not find it in the classpath.
Re: Filebot not launching (Error: Could not find or load main class)
Posted: 18 Feb 2022, 20:12
by nimefol684
If you need it, here's my filebot launcher config:
filebot.launcher.l4j.ini:
Code: Select all
# Default Java Options
--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.function=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.file=ALL-UNNAMED --add-opens=java.base/java.nio.file.attribute=ALL-UNNAMED --add-opens=java.base/java.nio.channels=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.time.chrono=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/sun.nio.fs=ALL-UNNAMED --add-opens=java.logging/java.util.logging=ALL-UNNAMED --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-opens=java.desktop/sun.awt=ALL-UNNAMED --add-opens=java.desktop/sun.swing=ALL-UNNAMED --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED -XX:+DisableAttachMechanism
# Default Windows Java Options
-Dsun.java2d.d3d=false -Dprism.order=sw -Dnet.filebot.UserFiles.fileChooser=COM -Dapplication.dir="%APPDATA%\FileBot" -Djava.io.tmpdir="%APPDATA%\FileBot\tmp" -Dnet.filebot.AcoustID.fpcalc="%EXEDIR%\lib\fpcalc.exe" -Djna.boot.library.path="%EXEDIR%\lib" -Djna.library.path="%EXEDIR%\lib" -Djava.library.path="%EXEDIR%\lib"
# Deployment Options
-Dapplication.deployment=msi
# Use Windows Shell for move/copy operations
-DuseNativeShell=true
# Force alphanumeric sort order to work around Windows Explorer DnD peculiarities
-Dnet.filebot.dnd.sort=true
# Support JAVA_OPTS and FILEBOT_OPTS environment variables
%JAVA_OPTS%
%FILEBOT_OPTS%
filebot.l4j.ini
Code: Select all
# Default Java Options
--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.function=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.file=ALL-UNNAMED --add-opens=java.base/java.nio.file.attribute=ALL-UNNAMED --add-opens=java.base/java.nio.channels=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.time.chrono=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/sun.nio.fs=ALL-UNNAMED --add-opens=java.logging/java.util.logging=ALL-UNNAMED --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-opens=java.desktop/sun.awt=ALL-UNNAMED --add-opens=java.desktop/sun.swing=ALL-UNNAMED --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED -XX:+DisableAttachMechanism
# Default Windows Java Options
-Dsun.java2d.d3d=false -Dprism.order=sw -Dnet.filebot.UserFiles.fileChooser=COM -Dapplication.dir="%APPDATA%\FileBot" -Djava.io.tmpdir="%APPDATA%\FileBot\tmp" -Dnet.filebot.AcoustID.fpcalc="%EXEDIR%\lib\fpcalc.exe" -Djna.boot.library.path="%EXEDIR%\lib" -Djna.library.path="%EXEDIR%\lib" -Djava.library.path="%EXEDIR%\lib"
# Deployment Options
-Dapplication.deployment=msi
# Use Java API move/copy operations
-DuseNativeShell=false
# Support JAVA_OPTS and FILEBOT_OPTS environment variables
%JAVA_OPTS%
%FILEBOT_OPTS%
Re: Filebot not launching (Error: Could not find or load main class)
Posted: 19 Feb 2022, 00:45
by rednoah
nimefol684 wrote: ↑18 Feb 2022, 18:18
Code: Select all
Error: Could not find or load main class D:\Skolo\2021-2022\?????\???????
Caused by: java.lang.ClassNotFoundException: D:\Skolo\2021-2022\?????\???????

How did you install FileBot? Where is the
filebot.exe located? Can you post the output of
SET so that we can see the environment variables you have set?

Please use the
*.msi installer package if you have trouble with the portable package. The
*.msi will always install into
C:\Program Files\FileBot and never elsewhere. It would be most strange if it were to search for application code in some random folder named "Skolo". Like how would it come up with "Skolo" in the first place if there wasn't some environment variable that overrides the class path or something akin to that.
Re: Filebot not launching (Error: Could not find or load main class)
Posted: 19 Feb 2022, 10:43
by nimefol684
[/quote]

How did you install FileBot? Where is the
filebot.exe located? Can you post the output of
SET so that we can see the environment variables you have set?
[/quote]
Very weird. The filebot opts are set to D:\Skolo\2021-2022\Слики\Домашни. Why would this happen in the first place? How do I change this?
Code: Select all
C:\Users\User>set
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\User\AppData\Roaming
ChocolateyInstall=C:\ProgramData\chocolatey
ChocolateyLastPathUpdate=132892480525610724
CommonProgramFiles=D:\Program Files (x64)\Common Files
CommonProgramFiles(x86)=D:\Program Files (x86)\Common Files
CommonProgramW6432=D:\Program Files (x64)\Common Files
COMPUTERNAME=DESKTOP-S2P1QNV
ComSpec=C:\WINDOWS\system32\cmd.exe
DriverData=C:\Windows\System32\Drivers\DriverData
[b]FILEBOT_OPTS=D:\Skolo\2021-2022\Слики\Домашни[/b]
GIT_INSTALL_ROOT=C:\Users\User\scoop\apps\git\current
HOMEDRIVE=C:
HOMEPATH=\Users\User
JAVA_HOME=D:\Program Files (x64)\Eclipse Adoptium\jre-8.0.312.7-hotspot\
JD2_HOME=D:\Program Files (x64)\JDownloader
LOCALAPPDATA=C:\Users\User\AppData\Local
LOGONSERVER=\\DESKTOP-S2P1QNV
NUMBER_OF_PROCESSORS=4
OneDrive=C:\Users\User\OneDrive
OS=Windows_NT
Path=D:\Program Files (x64)\Eclipse Adoptium\jdk-11.0.13.8-hotspot\bin;D:\Program Files (x64)\Eclipse Adoptium\jre-8.0.312.7-hotspot\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\BellSoft\LibericaJDK-8\bin\;D:\Program Files (x64)\VMWare\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;D:\Program Files (x64)\dotnet\;C:\Users\User\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\User\AppData\Local\Programs\Python\Python39\;C:\Users\User\scoop\shims;C:\Users\User\AppData\Local\Microsoft\WindowsApps;D:\zPrivr\FFmpeg\bin;C:\adb;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\FileBot\;D:\Program Files (x64)\MySQL\MySQL Shell 8.0\bin\;C:\Users\User\.cargo\bin;C:\Users\User\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\User\AppData\Local\Programs\Python\Python39\;C:\Users\User\scoop\shims;C:\Users\User\AppData\Local\Microsoft\WindowsApps;D:\zPrivr\FFmpeg\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 17 Stepping 0, AuthenticAMD
PROCESSOR_LEVEL=23
PROCESSOR_REVISION=1100
ProgramData=C:\ProgramData
ProgramFiles=D:\Program Files (x64)
ProgramFiles(x86)=D:\Program Files (x86)
ProgramW6432=D:\Program Files (x64)
PROMPT=$P$G
PSModulePath=D:\Program Files (x64)\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\Users\USER~1\AppData\Local\Temp
TMP=C:\Users\USER~1\AppData\Local\Temp
USERDOMAIN=DESKTOP-S2P1QNV
USERDOMAIN_ROAMINGPROFILE=DESKTOP-S2P1QNV
USERNAME=User
USERPROFILE=C:\Users\User
VBOX_HWVIRTEX_IGNORE_SVM_IN_USE=1
windir=C:\WINDOWS
Edit: I remember renaming files in that folder. I may have accidentaly done something and changed it.
Re: Filebot not launching (Error: Could not find or load main class)
Posted: 19 Feb 2022, 12:37
by rednoah
If you set
FILEBOT_OPTS to invalid option values, then FileBot will crash on startup. The value of
FILEBOT_OPTS must be a valid JVM option, e.g.
-Xmx512m. Accidentally permanently setting an environment variable is quite unusual and really bad luck. No idea how you could possibly have achieved that, but you should definitely play the lottery.

You can add, modify and remove Windows environment variables like so:
https://www.computerhope.com/issues/ch000549.htm

Note that you will need to restart CMD to inherit the new set of environment variables after you have changed them via the Windows settings.
Re: Filebot not launching (Error: Could not find or load main class)
Posted: 19 Feb 2022, 14:45
by nimefol684
rednoah wrote: ↑19 Feb 2022, 12:37
If you set
FILEBOT_OPTS to invalid option values, then FileBot will crash on startup. The value of
FILEBOT_OPTS must be a valid JVM option, e.g.
-Xmx512m. Accidentally permanently setting an environment variable is quite unusual and really bad luck. No idea how you could possibly have achieved that, but you should definitely play the lottery.

You can add, modify and remove Windows environment variables like so:
https://www.computerhope.com/issues/ch000549.htm

Note that you will need to restart CMD to inherit the new set of environment variables after you have changed them via the Windows settings.
THANK YOU. I managed to change it using the RegEditor in windows under "Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" and set FILEBOT_OPTS to -Xmx512m. That fixed it after a reboot. This has been bothering me for days and finding a solution that worked was very relieving.