Total noob-can't run gradle tasks - java

i'm trying to use Eclipse IDE to do an assignment but i can't run gradle tasks...
it says "no actions available"...i'm adding a picture for clarity.
i'll appreciate any help!
p.s. the project is built for java 8, i seem to have java 13... i also have java 8 on my pc but when i type "java -version" in cmd it says 13
UPDATE: I switched the jre version to 1.8 in Eclipse and now there's 1 error left (see picture below)
HERE IS THE LAST ERROR

I solved it!
there was a problem in the file itself, so i switched to intelliJ Idea.
i opened a new gradle project, created a new Java class at the appropriate place and copied the code to there :)
IntelliJ automatically chose an up to date version of gradle.

Related

InteliJ Mac Catalina: Java 11 or newer is required to run the IDE

Hello yesterday I updated my IntelliJ ide to the latest version (2020.3.2). The problem is that it's not starting anymore. When I try to open it, I get this error message:
I have two JDKs, 8 and 12
It seems like InteliJ does some kind of lookup by alphabetical order because when I rename my jdk 8 to other name that goes after the "jdk-12..." it actually works
The problem is that have to rename the folders and then return the original names to make my projects work, is there a way to avoid this renaming? Thanks a lot
This IntelliJ IDEA version requires Java 11 to run.
You override default bundled JetBrains Runtime with Java 8.
The solution is to remove this override. It's either idea.jdk file in the configuration directory or an environment variable as described in this document:
~/Library/Application Support/JetBrains/IntelliJIdea2020.3/idea.jdk
Note that JDK used to run IntelliJ IDEA itself is not related to the JDK that you are using to build and run your own projects. These two can be different.
I bumped into this issue with my PyCharm. In that case, pycharm.jdk was the one we need to remove.
~/Library/Application Support/JetBrains/PyCharm2020.3$ mv pycharm.jdk /tmp
Hope it helps someone came here by google.

Java Builder version 9 not supported

I'm somewhat new to Java. I'm getting the error below when trying to build my project.
Errors occurred during the build.
Errors running builder 'Java Builder' on project 'spring-data-marklogic'.
Version '9' not supported
From what I can tell it wants me to use Java 8. I've went into Eclipse (Spring Tool Suite) preferences and changed the JRE and JDK to be 8.
I've edited JAVA_HOME to also point to version 8.
However, 'java -version' tells me that I'm still using 9. Regardless, I would think that at least changing the Preferences in my IDE would fix it.
This makes me believe that maybe it's a different issue all together. Any help would be appreciated!

Where is Java 8 hiding?

This is probably a cliché question that was repeated a trillion times. But I'm asking here because I became fully and totally desperate and I need some pointers to continue.
I'm learning how to program games using LibGDX. I'm using this tutorial. The problem is the classic error:
Errors occurred during the build. Errors running builder 'Android
Package Builder' on project 'HelloWorld-android'.
com/android/dx/command/dexer/Main : Unsupported major.minor version
52.0
I understand that this error means that some how, Eclipse is using Java 8 to compile, and an earlier version of Java to run, which is creating this incompatibility. But guess what? I don't even have Java 8 on my computer! I have:
Android SDK
Java 7u79
Eclipse Luna
LibGDX, that generates the project for me.
I don't understand why this is happening, so please assist and tell me why this would happen. Following are screenshots of Eclipse showing that everything is 1.7.
And yet I keep getting this error on right click -> Debug As -> Android Application:
What did I miss? Where is Java 52 coming from?
I would like to point out that the Desktop version of the game runs with not a single problem.
Thank you for any efforts. Please don't hesitate in asking for more information.
It's not your code that requires Java 8.
"Error running builder 'Android Package Builder'
means something in the android build tools, some of which are also written in Java, require Java 8 to run.
You'll have to install Java 8 so that it runs Eclipse & gradle. Java 8 can compile for Java 7, so you don't have to change the project to Java 8 (which would also mean the app would only work with Android N and above).
The safest bet is to remove all Java < 8 versions from your computer, that way you can't accidentally run with an older version. You'll have to update the "installed JREs", set the default (& especially the one in the gradle screen) to your Java 8 install, but keep the project's "Compiler compliance level" at 1.7.

Java: Getting a "Requires JDK 5.0 or later" error in Eclipse

I have just installed the JDK1.8.0 32 bit version on my computer and that all seemed to work nicely. I then followed the instructions on this stackoverflow page to add tools.jar to the Eclipse (although, to be honest, I'm not quite sure what that means?). I'm still getting the error: "Requires JDK 5.0 or later. Please download it from http://java.sun.com/j2se/1.5/".
Could someone please help me understand what the problem is? Also, please let me know if I haven't given enough information, this is my first attempt at using Eclipse and I don't know if you need any other info.
Thanks
Mike
The Oracle JDK installation does not install Java in the location where Eclipse by default looks for it.
I would suggest that you go to http://java.com/en/download/installed.jsp and follow instructions to get a default Java installation on your system.
Eclipse will then use that to run itself. You can then tell Eclipse about your Java 8 JDK in Preferences -> Java -> Installed JRE's and that it is to be used by default by the projects you write.
Note that there is not full support for the new Java 8 facilities in Eclipse yet. That will most likely come in Eclipse 4.4 scheduled for June (http://wiki.eclipse.org/Simultaneous_Release)
When you make a new project, make sure it's using the JRE you want. You may have to change it from default to "use project specific JRE", and then select the 1.8.

Unable to run Java Applications in Eclipse [duplicate]

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.

Categories