PLEASE NOTE: THIS IS NOT A DUPLICATE. I want Gradle's IDEA plugin to correctly configure my IntelliJ IDEA CE project for me. I am not interested in any solution that involves manually tuning IntelliJ to find my JDK. This is a Gradle IDEA plugin feature that can and should work.
If you can find another question that involves correctly getting the Gradle IDEA plugin to configure IntelliJ (running on a Mac) so that it can find JDK 8+, then please by all means, mark this as a dupe and provide a link to that question. Otherwise, do not vote this as a dupe (it's not!).
Mac 10.9.5 here. Java 8 is my default JRE/JDK, and I just installed Groovy 2.4.6 and Gradle 2.13 via sdkman. I then installed IntelliJ IDEA CE.
On my terminal, I created a test-proj directory, and then inside that directory I issued the following Gradle command:
gradle init --type groovy-library
Gradle executed successfully, giving me a Groovy project skeleton. I then edited the generated build.gradle to contain the IDEA plugin:
apply plugin: 'idea'
And then I ran:
gradle wrapper
./gradlew clean idea
This generated the Gradle Wrapper for me, and I then used the IDEA plugin to generate IntelliJ project files for me. I then opened my brand-spanking-new IntelliJ IDE and went to Open my test-proj.
The project opened and everything appeared to be OK. But then I started coding and noticed that JRE classes such as String were not showing up as resolvable. So I went to File >> Project Structure and see this:
So it appears that IntelliJ can't find my default Java 8 JDK. I know the OS can find both the JRE and the JDK, based on the console ouput of java -version and javac -version. But something, between sdkman, Gradle or IntelliJ is preventing the IDE from finding Java. Any ideas?
I had the same problem, although i got it running by removing the .idea folder and reimporting the project by pointing to my build.gradle file. In the import dialog i selected the .ipr structure instead of using the idea "folder based structure" (default)
When executing gradle idea it will then generate an .ipr file in your project root configuring your project.
In my case the jdk was set properly and my modules were initialized correctly.
The reason behind using the .ipr files is, that the gradle idea plugin can't work with the directory based structure. See also:
directory based idea project with gradle
https://issues.gradle.org/browse/GRADLE-1041 (open for 6 years now)
Since i figured this out today i'm not sure how good this is working. Or what are the differences between directory based and .ipr based (.ipr based seems older?).
Related
I am new to eclipse theia IDE.I created theia as docker image. I ran docker image with java project workspace.
I am not able to compile and run Java projects. My doubt is I added Java related vs code plugins mentioned in https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack
But still my java or spring boot projects are not able to compile & run.
My question is Eventhough we already installed vscode java extentions and still we need to install jdk, maven manually or not.
Any suggestions or samples are much appreciated
Yes, the extensions only combine the 'jdk' or 'maven' and so on with the VSCode, so you need to install them manually.
'Language Support for Java(TM) by Red Hat' extension has settings of 'java.home', you can refer to this page for more information.
'Maven for Java' extension has settings of 'maven.executable.path', you can refer to this page for more information.
I installed Eclipse Neon and went to the marketplace and installed the Gradle IDE Pack 3.8.x + 1.0.x plugin. When I right click on the build.gradle file and choose run as > gradle build Gradle build I get an error that says "Gradle installation is not correctly configured go to Window -> Preferences -> Gradle(Enide) and configure the correct location.
I've tried multiple locations, including C:\ProgramData\chocolatey\lib\gradle\tools\gradle-3.1\bin, but none of them seem to be working.
Any and all help would be much appreciated!
EDIT: Also, I'm not sure if this is related but when I try "gradle build gradle" in the command prompt it says "Task 'gradle' not found in root project".
I've done some searching for both of these issue but don't seem to find then answer that seems right for my situation. I've used gradle before but never set it up in a new project.
Ok, after trying to figure this out for the past 24 hours, I found out that when I ran "choco install gradle", it didn't install the most recent version of Gradle. I uninstalled that, downloaded and unzipped the current version (3.3) and pointed the GRADLE_HOME environment variable to the new directory and changed the Gradle directory in the PATH env variable, I was able to run it in Eclipse. gradle build gradle still isn't working for me but gradle build is. As far as I'm concerned, this is working as desired now.
The only reason I was trying to use gradle build gradle was because of past experiences but maybe that was something that was already setup in the project? I'm not really sure but this seems like it's working the way it is supposed ot now!
I'm using IntelliJ to work with a Gradle project. I noticed that whenever I try to refresh the Gradle project (or when trying to import/re-import a project as a Gradle project) I get the following error:
Error: Could not determine the Java version
$JAVA_HOME is set, the SDK is set to Java 8 (and gradle -version confirms it is also is set to Java 8), and the project builds fine from the command line. Restarting IntelliJ also does nothing. I also deleted the project specific and global .gradle folders, which did not resolve the issue.
I am running IntelliJ 14.1.4 on Ubuntu 15.04 and Gradle 2.5.
EDIT: Tried it on a different machine (also Ubuntu 15.04, Oracle Java 8) running IntelliJ 14.1.1 and it worked correctly.
I had this problem too. It seems it was linked to the project being setup with a rather old gradle build. Changing distributionUrl to a new distribution in /gradle//wrapper/gradle-wrapper.properties solved it
You should try to switch Idea boot jdk. It works for me.
I have just switched to Ubuntu and I've installed IntelliJ IDEA 14 Community Edition. When I imported my existing project, I found that IntelliJ can't seem to find any of the LibGDX dependencies. I installed Gradle beforehand. I've tried using the Gradle wrapper included with the IntelliJ project to and saying ./gradlew --refresh-dependencies, but this doesn't seem to do much of anything. My external TweenEngine packages were loaded just fine. It seems to only be with the LibGDX packages that IntelliJ is having a problem with. I do not wish to have IntelliJ see my project as a Gradle Project, as then it will have to sync. I prefer to do things myself in that regard.
My guess is that Gradle isn't installing the LibGDX dependencies, but I'm not entirely sure why that would be happening. Shouldn't ./gradlew --refresh-dependencies install them? The errors I get are all the same as this one, just with different package names and different line numbers:
Error:(7, 24) java: package com.badlogic.gdx does not exist
The line numbers correlate to my LibGDX class imports, so this is what leads me to believe that Gradle is not installing the dependencies.
When I imported the project, I selected the build.gradle file. I have the local.properties file pointing to a valid Android SDK.
If you want a specific look at the project and would like more detail than I have provided, feel free to check out the source code: http://bitbucket.org/Sonic2kk/mr.-ballguy/
What could be causing these errors and how can I correct them?
Try installing the android sdk. If that doesn't work, try reinstalling IntelliJ.
Also, try linking your IntelliJ project to IntelliJ's Gradle plugin.
I'm learning how to build Jmeter with Eclipse.
I followed some online steps and downloaded Jmeter binary and source files, unzipped them into the same directory, created a java project in eclipse and used ant build but when i build i got the following error
\workspace\apache-jmeter-2.11\build.xml:801: Class not found: javac1.8
I'm using JRE8, JDK1.8 and ant 1.9.4.
Saw some similar post with answers saying that this is an issue with ant version < 1.9 but i'm already using ant 1.9.4.
Help please.
As that is a problem encountered with versions of Ant which are not compliant with Java 8, I suggest you check your Ant configuration. Go to your Eclipse settings and check it. Then, check your project settings, maybe you have project-specific settings which override your general Eclipse settings.
In the settings, you can choose which Ant install you want to use. By default, Eclipse is using it's own, which is probably not the last available. If you have installed Ant 1.9.4, you should select "External installation" or something, with the version of Ant you installed.
More infos here: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-ant-version.htm