How to use Jmonkey in another IDE

This error occurs:

ould not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.2-bin.zip'.
Build file '/Users/name/Desktop/Game/build.gradle' line: 196
A problem occurred evaluating root project 'Game'.
Could not get unknown property 'org' for root project 'Sad' of type org.gradle.api.Project.Java(0)

Try to manipulate it to the gradle properties file : org.gradle.jvmargs =-XstartOnFirstThread.

So do I replace

org.gradle.jvmargs += ['-XstartOnFirstThread']

with

org.gradle.jvmargs =-XstartOnFirstThread

I did that and it give me the same error

Once you get past this issue be aware you’ll need to add this to your main method

    app.setShowSettings(false); //Settings dialog not supported on mac

Mac support is unfortunately a work in progress in the template

Are you starting the application up from the command line by doing ./gradle run? Or does VSCode run the application for you?

VSCode runs the application for me

You need to add it as a gradle property in gradle.properties and since desktop template doesn’t have the gradle.properties file, you need to create it and place this jvm args inside it.

  1. Create gradle.properties.
  2. add org.gradle.jvmargs =-XstartOnFirstThread.

Ah, then there will be a VSCode way to set command line arguments (Specifically jvm arguments). I’m not a VSCode user so I’m not sure what that way is but it’s likely to be under something like ā€œRun configurationā€. This is how it looks in intelliJ

Would this be placed under the same folder as build.gradle or another folder? Sorry for barraging you with questions. Really appreciate all of you guys helping me.

1 Like

at the same folder.

So, i think you are using the debugger in vs code, if that’s the case, create the launch.json from here

Screenshot from 2022-05-20 22-09-28

if you have already a launch.json file, open it ( CTRL/META+SHIFT+P → open launch.json )
Then edit the launch.json file by adding "vmArgs": "-XstartOnFirstThread" in the launch configuration.

It should look something like

      {
            "type": "java",
            "name": "Launch MyApp",
            "request": "launch",
            "mainClass": "something.MyApp",
            "projectName": "MyApp",
            "vmArgs": "-XstartOnFirstThread"
        }

This should work.

1 Like

That’s a good tip too, i don’t know if this better or the same as using a gradle.properties file, anyway either this or that would need to be shipped with the gradle template for macOS, idk i am not a mac user just suggesting (gradle.properties might be better when running a cross platform project and terminal run).

You are right, the gradle.properties approach is much better, but I am not sure if it works when launched from the vscode debugger since it doesn’t launch through gradle

Are you planning on using the zipMacDistribution to bundle a zip that has a mac compatible JRE within it. Or will you just be relying on the distribution that assumes java is already installed on the machine?

I ask because I made some corrections to the zipMacDistribution this morning so I’ll go through them if you are planning on using it (A new template would start with these corrections but they are fairly minor; I don’t suggest starting over)

I usually use the ā€œclean and buildā€ option on the SDK, so I’ll probably use the default option for VSCode. But I can use this zipMacDistribution if it’s better

zipMacDistribution is for when you are finished development and want to give a distribution to customers and/or friends (who own a mac). The zipLinuxDistribution and zipWindowsDistribution should work correctly but the version of zipMacDistribution you have is incorrect (because I wrote it wrong, but have subsequently corrected it).

I guess I’ll use zipMacDistribution as well. But I’m also encountering an error when I’m trying to use the file from my SDK in your starter project

Are the libraries different from the SDK and this? If so what fixes do I need to implement

Never mind that previous comment. I’m encountering an issue using assetManager(asset not found). I’m using this line of code.

playerFootStep = new AudioNode(assetManager, "Sounds/FootStep.wav", DataType.Buffer);

I’ve double checked the file path and it should work. But I just copied the assets folder and placed it in the root directory of the project. I think I’m doing something wrong

The SDK likes to put sounds, textures etc in a slightly strange place. Your assets set up should be similar to this for a gradle project

image

Try moving them into the resources folder

You don’t seem to offer LWJGL3 as an option for your build. Since LWJGL3 is not built automatically for JME, do you plan on putting in that as an option.

@RealOPG Did the gradle.properties approach work for you ?