Running a Java program

Answered

Has anyone been able to install Fleet and run a Java program successfully? 

I have been trying to get this to work with no success. I followed the guide on Getting started with Java but I haven't been able to run the program as it is shown in the "Run and Debug" section. After I turn Smart mode on, I get an error (see the image attached).

I have tried installing Gradle with Homebrew and manually. Same with Java, I installed it with Homebrew, then download it from their website, but nothing seems to work. I don't know what else to do at this point. 

Has anyone had this issue and been able to solve it? 

0
5 comments

Based on the error - the problem is that the JDK used to run the application is not compatible with the Gradle version, used in project. Try using older JDK version in project. See Configure project JDK.

0

I initially installed Oracle OpenJDK 19.0.1, then Oracle OpenJDK 17.0.15, and I was still having the same errors, then installed version 11 with homebrew "brew install openjdk@11" and still no success. Although this time I have two errors, one displayed in the upper right corner and the other one at the bottom. 

 

0

Have you tried running/building from command line by Gradle? What result do you get with it?

Try setting the

org.gradle.java.home=/path_to_jdk_directory

in gradle.properties file in the project root directory.

0

I was able to fix it by deleting and uninstalling everything. I installed Fleet again, then installed Java SE Development Kit 17.0.5 from Oracle, then installed Gradle with Homebrew. This is how it looks now:

 

The folders on the left panel were all created when I executed gradle init and followed the steps from Getting started with Java, now let's say I want to create a new project with a simple hello world program, How do I do that? (instead of creating a new file and placing it under app/scr/main/java like the one in the image)

 

0

I want to create a new project with a simple hello world program, How do I do that?

Fleet does not provide wizard for creating new projects. Please use command line utilities for this.

0

Please sign in to leave a comment.