Today I turn on my laptop and STS shows me this error, and I dont have any idea, Why STS is raising this.
My java home is :
and my gradle project is using java 1.7.
Maybe you can help me to solve this problem.
Thank you.
This can be related to having multiple jdk installs and can be fixed by renaming the other jdk folders, however the true problem here may be caused by a symlink in /jdk1.8.0_71/jre/lib/tools.jar pointing to jdk/1.8.0_71/lib/tools.jar. Remove the symlink and see if Gradle works.
Related
I have Macbook with macOS (latest) running on it. I've installed the latest Intellij IDEA (2020 ultimate) and JDK 8 on it. When I try to compile a simple class it never finishes (build never completes).
I've tried to uninstall and reinstall Intellij IDEA and JDK. No success. I even tried to use different JDK (14) through Intellij IDEA download menu. No success. Any thoughts, ideas, suggestions?
Here what I did. I've installed previous version (2019). And after that I just removed app in Application. I've left all the settings untouched. After that I've installed 2020 and it works just fine :)
Thanks to everyone for giving me directions! Hope it will help anyone in the future.
Try with antivirus/firewall disabled or make sure that IDE settings directories IDE installation home, IDE executable and project files are excluded from the scan.
I'm rather new to IntelliJ IDEA and Grails in general. I just started a new Project, selected my project JDK (11.0.1) and Gradle distribution (4.10.2). Whenever I try to run the project, I get this error:
Error initializing classpath: Could not determine java version from
'11.0.1'. java.lang.IllegalArgumentException: Could not determine java
version from '11.0.1'. at
org.gradle.api.JavaVersion.toVersion(JavaVersion.java:68) at
org.gradle.api.JavaVersion.current(JavaVersion.java:78) at
org.gradle.internal.jvm.UnsupportedJavaRuntimeException.assertUsingVersion(UnsupportedJavaRuntimeException.java:29)
at
org.gradle.tooling.internal.consumer.ConnectorServices.checkJavaVersion(ConnectorServices.java:66)
at
org.gradle.tooling.internal.consumer.ConnectorServices.close(ConnectorServices.java:53)
at
org.gradle.tooling.internal.consumer.DefaultGradleConnector.close(DefaultGradleConnector.java:57)
at
org.grails.cli.gradle.cache.CachedGradleOperation.call(CachedGradleOperation.groovy:78)
at
org.grails.cli.GrailsCli.populateContextLoader(GrailsCli.groovy:525)
at org.grails.cli.GrailsCli.initializeProfile(GrailsCli.groovy:508)
at
org.grails.cli.GrailsCli.initializeApplication(GrailsCli.groovy:306)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:269) at
org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
All other discussions of the problem I found suggested changing the Gradle distribution, which I already did. I would be so happy if anybody could help me out here.
Cheers!
May be your java configuration is not correct. If not correct follow this steps.
Goto File-> Project Structure.
Change SDK
Or gradle version is not matching jdk 11 then skip this answer.
Besides the issue with Gradle above, if you're trying to run a Grails project I don't think you can do that with JDK higher than version 8.
Even the latest Grails (3.3.8 as of this writing) is still based on SpringBoot 1.5 which does not support newer JDK, I don't know if there's a special trick to make it work.
I had to delete the .gradle directory and restart Intellij.
I have a JavaFX app that I build with Gradle and Java 8. I recently got a new laptop and installed Java 10 JDK instead of Java 8 and didn't think it'd be a big deal. However, when I try to import the Gradle project into Intellij I get this error:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'MyProject'
Caused by: org.gradle.api.GradleException: Couldn't find Ant-JavaFX-library, please make sure you've installed some JDK which includes JavaFX (e.g. OracleJDK or OpenJDK and OpenJFX), and JAVA_HOME is set properly.
at de.dynamicfiles.projects.gradle.plugins.javafx.JavaFXGradlePlugin.addJavaFXAntJARToGradleBuildpath(JavaFXGradlePlugin.java:112)
More....
I have set JAVA_HOME in the Windows env vars to this path:
C:\Program Files\Java\jdk-10.0.1
How can I solve this problem?
Thanks!
Thanks for the comment feedback on this post I was able to find the problem. I first verified that the JDK 10 installation did drop off ant-javafx.jar into the lib/ dir in JAVA_HOME. It did..!
So it must be Gradle or Intellij.. right? Well there's only one super easy way to build a JavaFX gradle project at the moment and that's with javafx-gradle-plugin. Looking up the repo I can see the last release was a year ago! RED FLAG! Looking through the code I found a pathing check for a now defunct relative path that drops the verbatim error above.
So I submitted a Pull Request to the developer of the project and hopefully that resolves the issue..
That's here: https://github.com/FibreFoX/javafx-gradle-plugin/pull/128 .
In the meantime, I solved locally by copying ant-javafx.jar from it's real path at C:\Program Files\Java\jdk-10.0.1\lib\ant-javafx.jar out into C:\Program Files\Java\lib\ant-javafx.jar. Then I rebuilt the Gradle project and everything worked accordingly, confirming the solution in the PR above.
If you're building JavaFX apps with Gradle right now, you're likely to encounter this issue until the developer fixes it. He claims he's working on a brand-new plugin right now but the last release of this widely used plugin was over a year ago.
Thanks!
I'm trying to get started with Eclipse/Java/Scala on a MacBook. The installed JDK was 1.5. The SDT plugin for Scala requires 1.6 which was included in an OS update, but I also manually installed a package from Apple to update 1.6.
The problem is that I cannot run anything from Eclipse. I always get the following error:
An internal error occurred during: "Launching TestFooBasicTest".
Could not initialize class com.ibm.icu.impl.JavaTimeZone
I also tried to use the old 1.5 version, but to no avail.
What is going wrong here?
I had the same problem trying to run a scala program with Ubuntu 10.4 and stock eclipse (Galileo 3.5.2) and java (java-6-openJdk ) - and the scala pluging downloaded from scala site, of course. I fixed it by manually changing /usr/lib/eclipse/plugins/com.ibm.icu_4.0.1.v20100125.jar as suggested in this thread (btw I discovered that Emacs can change a jar file in place: nice):
http://www.eclipse.org/forums/index.php?t=msg&goto=488654
It's caused by ubuntu openjdk package with broken symbol links for TimeZone configuration. The best solution from forum thread is,
Reinstalling tzdata-java was the fix for me:
sudo apt-get --reinstall install tzdata-java
The problem is:
An internal error occurred during: "Launching TestFooBasicTest". Could not initialize class com.ibm.icu.impl.JavaTimeZone
A quick google search reveals that this class belongs to the IBM Globalization package ICU. http://www-01.ibm.com/software/globalization/icu/index.jsp
A guess would be that this is a package used internally by Scala that you have not installed properly, causing Scala startup to fail.
Make sure that you set java 1.6 in the run configuration (Run/Run configurations).
Did you upgrade to Snow Leopard? Are you using the Eclipse SWT/Carbon or the Eclipse SWT/Cocoa? I was seeing some strangeness with Eclipse after I upgraded to SL. Switching to the Eclipse SWT/Cocoa from Eclipse SWT/Carbon helped. Also restoring my 1.5 VM, which the SL install removes in a sneaky way(by deleting and leaving the symbolic link pointing to 1.6), helped me fix several issues with Java code that had natives(i.e. usb-serial port code).
Check what are the JVMs that Eclipse is aware of and where they are located (Preferences -> Java -> Installed JRE), and also check the run/debug configuration of your programs. By default, Eclipse knows about the JRE that was used to launch itself, and other JREs that you add manually. However, if you upgrade some components and the JREs changed, Eclipse can get "confused" about them.
I had this same issue with Eclipse on Windows. I tried a number of different things including a new hello world program in a new workspace. I finally got this to work by pointing Eclipse to a different JRE to execute with. I know that Apple provides the JRE for Mac, but it does seem like this issue is related to Eclipse having trouble with the JRE used to run Eclipse itself. See here for configuring which VM Eclipse executes with.
I downloaded eclim, and according to the installation guide
it requires Eclipse Helios 3.6.x.
So, I went and installed that version of Eclispe manually because it is not at Ubuntu's repositories.
What happened next was that, when I tried installing eclim, it said that it cannot recognize the eclipse version that I have.
Do you have any suggestions of how to resolve this issue?
The Eclipse that you install manually is not usually on the path that Eclipse is installed to when using the software center. I had this problem too while trying to install eclim.
There are two ways to fix it.
You can specify where the new Eclipse is installed to from your manual installation. For example, I manually installed Helios to $HOME/eclipse. When the installer gets to the point where it asks for eclipse's path, I specified it as /home/username/eclipse, replacing username with my name of course. That should find the helios installation, and not the installation in /usr/lib/eclipse.
The second way to do it is to manually make and install eclim from the repositories. The guide for this is here, http://eclim.org/guides/development.html#development-build. That will work you through building eclim from the development build, which may be better anyway as there may be new features not in the release version. Be sure to specify the eclipse home files in the Ant command, like so, ant -Declipse.home=/where/you/installed/eclipseto
Hope this helped, and merry days using eclim. It's really great.