Upgrading Gradle - java

I am fully aware that there are pages on the Gradle website that say how to upgrade, but only from 4.x and up.
I am trying to follow a tutorial in making a simple 'my first' Minecraft mod. In it, you are told to install forge 1.7.10, which, from what I understand runs on Gradle 2.0.
In order for me to continue with the tutorial, after some digging, it appears that Gradle 2.0 is not compatible with JDK 12.0.2, but I'm not entirely sure how to solve this.
any help is much 'preciated.

extending the answer from Chriki, you can change the gradle version in $projectroot/gradle/wrapper/gradle-wrapper.properties
here you can change the path to point to already downloaded gradle-bin,
something like this (distributionUrl=../../../build/tools/gradle-4.10.3-bin.zip)
or directly to gradle repository
(e.g. distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip)

I’m afraid, you have a chicken and egg problem here: your JDK 12 requires a recent Gradle version (at least 5.4, if I’m not mistaken). At the same time, the forge plugin that is used in your build doesn’t support Gradle 5, yet.
Maybe you can install and use JDK 11 instead? In that case you could work with Gradle 4 with which the forge plugin also seems to work. With my JDK 11 installation I could get the build to work as follows:
sed -i 's/gradle-2.0/gradle-4.10.3/' gradle/wrapper/gradle-wrapper.properties
This changes the Gradle wrapper version to 4.10.3 in gradle/wrapper/gradle-wrapper.properties (can also be done manually with a text editor). When I now run
./gradlew project
the build seems to generally work fine. It only complains: “You must set the Minecraft Version!” That’s a different matter, though.

For anyone here from Google, Minecraft Forge versions below 1.12 DO NOT SUPPORT any java version besides JDK8. You need to install JDK8.
The maximum version you can update your Gradle to is therefore 4.8.1, as any versions above that require JDK9.

Related

The Android Gradle plugin supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher

I am trying tog get my React Native app (with expo modules, but not built on expo) deployed to the Google Play Store, and I keep getting this error when I try to build...
The Android Gradle plugin supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher.
The following dependencies do not satisfy the required version:
project ':expo' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10
My issue us, the line that it seems to be referencing, project ':expo' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10 doesn't exist anywhere in my code, maybe in the node modules but I have no way of knowing.
I have absolutely no idea what kotlin is and never heard of it before this. I tried looking around for where to upgrade by kotlin-gradle-plugin, but thats nowhere in my app.json or package.json or any other config files. I saw some message boards with similar issues telling me to change this line inside of build.gradle
classpath('com.android.tools.build:gradle:7.3.0')
to make 7.3.0 match the version I need, but I firmly believe 7.3.0 is greater than 1.6.20, so I highly doubt that solution has any actual merits
Apparently, the current version of expo-modules are incompatible with the latest version of React Native (0.70.0) and how it compiles Android Builds. I downgraded react-native to 0.69.5. This ultimately led me to other issues but hopefully this can help somebody else.

Plugin for Java 15 support in eclipse 2020-09 no longer available

This question is similar to this one. I know you need to have this plugin to support Java 15 in eclipse 2020-09, however, it doesn't seem to be available any longer.
When I try to install it via the marketplace, I am getting this error:
No repository found at
https://download.eclipse.org/eclipse/updates/4.17-P-builds/.
Is there a way to install it from other sources?
I know that eclipse 2020-12 has been released, but we cannot use it due to bug #569498 (which didn't happen in eclipse 2020-09). So we would really need a way to install Java 15 support in eclipse 2020-09.
Because of regressions in 4.18, I decided to recreate 4.17-P-builds repository.
Please note this will be available till 4.19 is released or we decide to create a patch for 4.18 release.
I got a answer from the eclipse forums
Java 15 support is included in eclipse 4.18(2020-12). As part of
cleaning old releases we removed 4.17-P-builds repo as it is not
supported anymore.
Please upgrade to 2020-12 to continue work on java 15

Eclipse not exporting latest version as runnable JAR

Simple as that - my eclipse (Mars Release (4.5.0) EDIT: Oxygen.2 Release (4.7.2)), when exporting a runnable JAR using the correct run configuration, keeps releasing a version of one of my classes as a version approximately 2 days old instead of the latest. I noticed as the functionality has changed rather drastically, yet the JAR keeps acting the same.
Yes I'm definitely overwriting the previous version.
Thanks for suggestions.
It appears this is a known bug, as reported on the Eclipse forums here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=525711
Here is the full answer:
The easiest workaround at the current moment is to use an older
version of the jdk for eclipse. This can be done by going into
Window->Preferences->Java->Install JREs and adding the older jdk
folder.
I've rolled back to jdk8 and the eclipse's export jar works fine, in
most cases.
If you really need to use Java9, then you're best bet is to manually
create the jar using javac or using another build system like Gradle.

JavaFX on Android - Gradle can't find JDK

I'm trying to get JavaFX applications to run on Android by using the Dalvik JavaFX-Android SDK (provided by the JavaFX Android porting team). So I downloaded the samples provided by the JavaFX Android porting team and have been trying to run one of them on Android without much success.
Using Eclipse with the Gradle plugin I imported the "HelloWorldFxml" sample project. Then I ran the Gradle task "./gradlew androidInstall" on the project like the README file told me. But unfortunately the task cannot execute because Gradle cannot locate my JDK:
(source: forumbilder.se)
Even though my JAVA_HOME system variable is correctly set and I havn't had a problem with it before:
(source: forumbilder.se)
Anyone that can provide some insight as to how I can fix this?
Versions: Eclipse Luna Service Release 1a (4.4.1), Gradle 2.2, dalvik-sdk-8u40-ea3, Android SDK Build-tools 21.1.2, Android SDK Tools 24.0.2
Edit: The console output when running "gradlew androidinstall" on a sample project:
Even though the error message doesn't specify it, maybe it's looking for javac in your PATH? In case it's not in there try adding ;%JAVA_HOME%\bin to the end of your PATH variable (and restart Eclipse afterwards, I've had the problem of running processes not getting changes to environment variables before).
Check the Java setting in Eclipse:
Window -> Preferences
Java -> Installed JREs
Make sure that your JDK 1.8 is listed there. If it's not, add it using the Add... button.
Once the JDK is known to Eclipse, make sure that your project's settings use that JDK as a compiler, and the Gradle plugin should be able to pick up the setting from there.
In a pinch, you should also be able to run Gradle from the command line, and it should work fine since you already set the %JAVA_HOME% variable.
Basic Note
Since the release of dalvik-sdk-8u40-ea3, and in very short time, the JavaFXPorts team has released a few new versions, all of them simplifying all the process of porting a JavaFX application to Android or iOS.
They released dalvik-sdk-8u40-ea4 and they announced the release of a new plugin, that will simplify to the minimum the steps to create a mobile application from JavaFX.
While this answer may not help the OP in his particular problem, definitely it will help him and others, since everything is really simplified.
New approach
With this plugin, there's a new way of creating the HelloWorldFxml application for Android.
The new javafxmobile-plugin allows you to generate the apk with a single 'build.gradle' file.
You can find this an other basic samples here, and download the repository here.
You won't need to edit a single line, just type this on the command line, on the root of the sample, with your device connected:
gradlew androidInstall
As for previous releases, you will need JDK8u40 and Android SDK installed. No need for dalvik-sdk though, it's retrieved by the plugin.
Notice that you can open these samples from your IDE, so you will be able to modify them, and run them locally or build again the apk for your device.
Had this problem, too.
My proberties:
-Windows 7
-Dalvik SDK (dalvik-sdk-8u60-b5)
-JDK 8 (newest Version 8_60 / IMPORTANT: JDK not JRE)
-And I tried also the HelloAndroid project provided by the Dalvik-SDK-download.
So i execute the command line: gradlew installDebug
My probelm was nearly the same.
"Fail to find JDK. Please make sure there is a JAVA_HOME or JAVA8_HOME systemvariable."
#1
Created these proberties. Just like described in this post:
How to set java_home on Windows 7?
So to make everything sure, I created both with the same path. Cause I don't know exactly which one is used by gradle.
#2
This is really the hack that helps me out. Found this also in StackOverflow.
Write in your build.gradle under the android{..} stuff this line:
retrolambda {
jdk 'C:/Program Files/Java/jdk1.8.0_60' //<--your JDK-path
}
it looks like that
Then execute the same command line again and it worked for me.
I think only the 2. steps was the solution, cause I guess gradle don't look for the variable if there is a direct path to the jdk.

Why wouldn't I want to use the newest version of Eclipse?

I do mostly google app engine coding, and a little bit of android development, and don't understand why I wouldn't want my Eclipse ide to always be at the most recent release, or version. It seems like there are some plugins that wouldn't be compatible, but couldn't you just install the missing features from an old release of Eclipse into the newest release?
I'd say that always having the most up to date version of program x really isn't necessary. I think the most important thing is having a set of tools that you know how to use well. Upgrade those tools when there is a reason to do so, not just because there is a new version of them.
By far the predominant reason for not upgrading is lack of support for the new release from the plugins that you require. You cannot just install "missing features". Most of the time, the incompatibility is due to changes in the new version of an existing feature. Plugins that ship from eclipse.org are tested together in coordinated releases. While in some cases, it may be possible to down-version a plugin and have that plugin still work in the new version of Eclipse, it is not something that you can depend on working. In fact, the odds of this working without issues are so small, that I wouldn't bother trying.
Stick with whatever version of Eclipse your required plugins support until those plugins upgrade their support. If they aren't moving fast enough, consider pestering the provider about this issue. If nothing else, knowing how big of a chunk of the community cares about support for the latest version of Eclipse will help the plugin provider prioritize their work.
You can do that. If you want to compile against an older Eclipse version, this can be done very easily.
e.g. if you want to develop with Eclipse 3.6:
download Eclipse 3.5 and extract it (e.g. c:\development\targetplatforms\eclipse3.5).
start Eclipse 3.6, choose your workspace where you want to use the Target Platform.
open the Menu Window->Preferences, type target in the search field, and add a new Target Platform (Nothing: Start with an empty target definition -> Add -> Direcotry -> choose the unzipped Eclipse 3.5)
There are some advantages of using a target platform. You have the newest IDE Features. You can build your product against older Eclipse Versions without having to port it to your newses IDE version. You can add Plugins to your Target Platform without contaminating your ide or add Plugins to your IDE withoud contaminating your Target Platform. ...
You should bundle your Target Platform with your Project, so you don't have to download it again. We have a TargetPlatform Project in our SVN Repostory. Every Project has a small readme how to setup the Workspace (targetplatform, deployment, ....).
Why wouldn't I want to use the newest version of Eclipse?
Because IntelliJ IDEA provides a Community Edition. :)

Categories

Resources