Closed je-hal closed 2 years ago
Thanks for reporting the problem. Java 8 currently is sufficient to run the BFG (tho', as a side note, I'd recommend Java 11 as Java 8 is EOL). I've just verified this now (executed under Ubuntu Linux 20.04, not under WSL or Windows):
$ wget https://repo1.maven.org/maven2/com/madgag/bfg/1.14.0/bfg-1.14.0.jar
$ /usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07)
OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)
$ /usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java -jar bfg-1.14.0.jar
bfg 1.14.0
Usage: bfg [options] [<repo>]
...
A small note - the BFG does not have a -version
option, so when you ran:
bfg -version
...I would see this output, starting with a Unknown option
error:
Error: Unknown option -version
bfg 1.14.0
Usage: bfg [options] [<repo>]
...
...but you saw:
Error: Could not find or load main class use.newer.java.Version8
That's a pretty surprising error. The BFG uses https://github.com/rtyley/use-newer-java to attempt to give a user-friendly error if the user is using a version of Java that is older than Java 8. However, on your system, Java is not even finding the class called use.newer.java.Version8
.
If you use jar -tvf bfg-1.14.0.jar
to list the contents of the jar file, do you see the compiled class file? This is what I see - the class file that is normally the first thing that's executed:
$ jar -tvf bfg-1.14.0.jar | grep Version8
508 Sun Jan 07 22:20:02 GMT 2018 use/newer/java/Version8.class
If you want to bypass the Java-version check, you can use -cp
and specify the main BFG class:
java -cp bfg-1.14.0.jar com.madgag.git.bfg.cli.Main
@rtyley
Thank you for the quick response (and for the hint with the non-existing -version
option).
I now use the following working installation:
In this constellation, it works.
Although I was able to execute java.exe installed on Windows from WSL2, I always ended up with the error above (use.newer.java.Version8
), no matter what I tried. Probably it's a problem with the Java environment variables - I dug into it (If someone else would like to give it a try, see how to Share Environment Vars between WSL and Windows), but gave up in the end.
Hi,
I use WSL2 on Windows 10 to run Ubuntu.
On Windows, downloaded the BFG jar (1.14.0) in and installed JRE 1.8.0_311. Then I moved the JAR file to /usr/local/bin on WSL2.
Executing
java.exe
from WSL2 works fine:However, executing bfg brings up an error:
Sounds to me as if Java 8 is no longer sufficient to execute BFG, although it says in the Requirements section of the documentation that Java 8 should do:
Is there a specific java 8 version required? Thanks