Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Gradle project via Eclipse errors "system Cannot find System Java Compiler"

When I run Gradle project via Eclipse I get below error.

system Cannot find System Java Compiler.

Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.

Could not execute build using Gradle installation 'C:\gradle-1.2-all\gradle-1.2'.

But I have installed JDK 1.7 and set the JAVA_HOME environment variable.

like image 886
surekha Avatar asked Jun 04 '13 08:06

surekha


People also ask

Does Gradle work with JDK 16?

Also in Gradle 7.0: For Android, performance has been improved for incremental changes in projects, especially those using the Jetifer tool to migrate libraries. Gradle now supports running on and building with Java 16, or Java Development Kit (JDK) 16, which was released on March 16.

Can we use Gradle in Eclipse?

In the Eclipse IDE, you can execute tasks from the Gradle Tasks view.


2 Answers

Go to File -> Other Settings -> Default Project Structure

enter image description here

Now Set your JDK location

enter image description here

like image 178
Kishan Vaghela Avatar answered Oct 02 '22 13:10

Kishan Vaghela


In Preference of Eclipse (main menu: Window -> Preferences), select

Gradle -> Arguments -> Java Home, select "Workspace JRE".

Then select one of your jdk in your workspace.

On my laptop it's "jdk1.6.0_45". Yours should be the JDK 1.7 home folder, something like "/usr/lib/jvm/java-7-openjdk-amd64/".

like image 27
Leo Avatar answered Oct 02 '22 14:10

Leo