Intellij Idea - Gradle: Execution Failed for Task ':Compilejava'

Intellij Idea - Gradle: Execution failed for task ':compileJava'

Try this:

1) File -> Invalidate caches / Restart

2) Shutdown Intellij Idea

3) Remove .gradle folder in the user home directory

4) Restart Intellij Idea let it download all the Gradle stuff it needs

After this it should builds successfully

Hope it helps)

IntelliJ Using Wrong JDK - Execution failed for task ':compileJava'. > invalid source release: 11

Configure IntelliJ IDEA Gradle JDK: Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Gradle | Gradle JVM.

Gradle JVM

How do I fix Execution failed for task 'compileJava' error. (Using Intellij Idea and Gradle)

com.afollestad:ason:1.4.16 is located at:

https://repo.spring.io/libs-release/com/afollestad/ason/1.4.16/

You need to add one more repository to your repositories list:

maven { url 'https://repo.spring.io/libs-release' }


For next time, this answer was found by:

  • Google com.afollestad:ason:1.4.16

  • Click the com.afollestad » ason » 1.4.16 - Maven Repository search result link

  • Read the note:

    Note: this artifact it located at Spring Lib Release repository (https://repo.spring.io/libs-release/)

How to resolve compileJava errors during heroku deployment?

First you have to ensure your local development and your deployed instance are using the same version.

You specified a version with system.properties with content java.runtime.version=11 but haven't provided an image of the updated log. The log still says you are installing JDK 1.8.

Furthermore you should specify a Java version that is currently being supported. You can find the versions here: https://devcenter.heroku.com/articles/java-support#supported-java-versions

Java 7 - 1.7.0_302  
Java 8 - 1.8.0_292
Java 11 - 11.0.11
Java 13 - 13.0.7
Java 15 - 15.0.3
Java 16 - 16.0.1

Execution failed for task ':compileJava'

The first error message,

class GUIRenderEventClass is public, should be declared in a file named GUIRenderEventClass.java public static class GUIRenderEventClass

indicates that your Java source is in a file whose name does not match the Java class name in the source code. Both the Java source file name and the Java class name of the class in a file must match. Its how the Java compiler finds things.

You also have a number of errors of the same type that are something like:

 C:\Users\USER\MCreatorWorkspaces\trevcorp_meat_paste\build\sources\main\java\net\mcreator\trevcorp_meat_paste\MCreatorBatMeat.java:18: error: cannot find symbol public void playerKilledBat(livingDropsEvent event)

This means that when the Java compiler is processing the source code it is discovering a symbol or type or name of some kind that it doesn't know about. This is an error that means the symbol or type or name that is indicated is not found when the Java compiler searches for it.

There are several reasons for this to happen.

The most usual case is a missing import directive for a file that contains the symbol or type or name. This is the most probable cause for a "symbol not found" error that involves a type. It looks like you have several cases of a "symbol not found" which probably are due to a missing import file such as:

  • class livingDropsEvent is the symbol not found
  • class itemStack is the symbol not found
  • class EntityItem is the symbol not found

Also the variable items is not found. I assume it is a global variable somewhere probably in an import file as well.

Look at this article on Jabelar's Minecraft Forge Modding Tutorials, Minecraft Forge 1.7.2/1.7.10 Changing Drops of Vanilla Entities as well as Minecraft Modding: Event Handling, for some details about these symbols.

Also look at the sample code in this mincraftforge forum, https://www.minecraftforge.net/forum/topic/28747-how-to-add-a-drop-to-a-vanilla-mob-1710/ which contains this sets of import directives:

   import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraftforge.common.ChestGenHooks;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.event.entity.living.LivingDropsEvent;

Finally you have some warnings:

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

These warnings may or may not be important. If they are from some source that you are using from some library, you may not be able to address these. Your application may work regardless of these warnings.



Related Topics



Leave a reply



Submit