jsettlers / settlers-remake

A Remake of "The Settlers III" for Windows, Linux, Mac and Android
http://www.settlers-android-clone.com
MIT License
355 stars 101 forks source link

Problems when building the project #675

Closed Karol-G closed 7 years ago

Karol-G commented 7 years ago

I tried multiple times to build the project, but failed miserably at it. I followed the instructions of the "Compiling using gradle" guide but when I try to run ./gradlew :assembleDist it says "Task 'assembleDist' not found in root project 'settlers-remake'". So I tried to run ./gradlew build, which failed with "When running gradle with java 5, 6 or 7, you must set the path to jdk8, either with property retrolambda.jdk or environment variable JAVA8_HOME". I am unsure now if the guide is outdated and what commands I have to run. My OS is Ubuntu 16.04.

andreas-eberle commented 7 years ago

Can you try running gradlew release?

Karol-G commented 7 years ago

Fails with "When running gradle with java 5, 6 or 7, you must set the path to jdk8, either with property retrolambda.jdk or environment variable JAVA8_HOME" too.

andreas-eberle commented 7 years ago

Please try creating a file gradle.properties in the root folder of the settlers project and add

java8Home=<PATH-TO-JDK8>
java6Home=<PATH-TO-JDK8>

(please note, you can use JDK8 paths for both)

Does this help?

Karol-G commented 7 years ago

sadly no. Still same error

andreas-eberle commented 7 years ago

Which IDE are you using?

Karol-G commented 7 years ago

I have inteliJ installed. But currently I am doing everything in the terminal.

andreas-eberle commented 7 years ago

I'll try to reproduce it and then see how to fix it. However, this will probably take some days :( Sorry for the trouble...

Karol-G commented 7 years ago

No problem. I have time :)

michaelzangl commented 7 years ago

You need to have the current JDK. Ubuntu 16.4 is an LTS release but has java 8 available.

You can download it manually from oracle and then run

export JAVA8_HOME=/path/to/your/jdk1.8.0_xx/
./gradlew build

(tested on Ubuntu 14.4)

Alternatively to downloading it, you can install the current java version:

sudo apt-get install openjdk-8-jdk openjdk-8-demo openjdk-8-doc openjdk-8-jre-headless openjdk-8-source 

If you already installed it, you should find the install directory by running:

update-alternatives --list javac
Karol-G commented 7 years ago

OK got everything working now. I assume my JDK installation was messed up. So I did a clean setup and after some tries I was able to build the project with ./gradlew release Thanks for the help :)

andreas-eberle commented 7 years ago

Great 👍