eclipsesource / megit

Standalone Git GUI based on EGit
Eclipse Public License 2.0
408 stars 38 forks source link

Fail to build Megit on Linux #34

Closed spaceKelan closed 1 year ago

spaceKelan commented 1 year ago

Hi there 👋🏼 ,

I am on CentOS7 and I tried this:

I installed Java 17 and maven (3.0.5) via

sudo yum install <maven>

When I try to build via

mvn clean install

I get the following error: image

So I tried to install maven 3.9.4 with wget.

Then I got the following error:

Caused by: java.lang.UnsupportedClassVersionError: org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant 
has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the 
Java Runtime only recognizes class file versions up to 52.0

Therefore, I tried to figure out which Java to install and according to stackoverflow I need this Java SE 8 = 52 - which is lower than the minimum Java you need.

Before it gets really wild, which maven would I need at least?

Please help.

planger commented 1 year ago

Hi @spaceKelan, I'm on Ubuntu 22.04.2 and use maven 3.9.2 and Java Temurin-17.0.8+7. Maven however by default takes the Java version that is referenced from the environment variable $JAVA_HOME. So maybe in your case this environment variable points to an old Java?

spaceKelan commented 1 year ago

hi @planger - thanks for your response!

that sounds reasonable and it resolved the issue!

I went for

java -version // would print 17...
which java

traced the symlink to set in /etc/profile.d/maven.sh as described here (but with wget https://dlcdn.apache.org/maven/maven-3/3.9.4/binaries/apache-maven-3.9.4-bin.tar.gz -P /tmp)

$JAVA_HOME=/usr/lib/jvm/jdk-17-oracle-x64/

After sourcing it I ran mvn clean install again and got a BUILD_SUCCESS image

spaceKelan commented 1 year ago

@planger even though I built it successfully I receive this error message when trying to run

megit
bash: megit: command not found
planger commented 1 year ago

I'm glad I could help resolving your build issue. The build command above just builds it, but doesn't install it in your system. The "binaries" end up in megit/com.eclipsesource.megit.product/target/products/com.eclipsesource.megit. There should be a folder for your architecture with an executable called megit in it and that should be runnable.

If you want to install that on your system, you'd have to put this folder that contains the executable in your path.

Please note that you could also just download from the releases to get the same thing as in the target/products folder without having to build locally.