Getting SpiderMonkey To Work

Hello everyone,



I am new to JME3 and have completed most of the beginner tutorials. I wanted to get my feet wet with SpiderMonkey and work on some VERY basic networking. However, being the noob I am, I can’t get it to run. I’m getting an error with the com.jme3.network import, which in return makes more than half my code unusable as it isn’t recognized because the import won’t work.



Do I have to manually install SpiderMonkey or something?

Right-click your project, select “Properties”, go to “Libraries”, press “Add Library” and add the “jme3-libraries-networking” library.

For some reason, still not working.



For example, I imported ‘com.jme3.network.*’ and I still get a “cannot find symbol” error when trying to create something of type ServerMain.



Here is the code copied directly from the SpiderMonkey networking tutorial:

[java]

public class MyGameServer extends SimpleApplication {

public static void main(String[] args) {

ServerMain app = new ServerMain();

app.start(JmeContext.Type.Headless); // headless type for servers!

}

}[/java]



I imported ‘com.jme3.app.SimpleApplication’ and ‘com.jme3.network’.



I’m also getting an error on ‘JmeContext’.

Your class is called MyGameServer but you are instantiating ServerMain. Is that on purpose or a typo in your code?

@artxuleta said:
I'm also getting an error on 'JmeContext'.


It's very frustrating to debug problems in your code if we can't see the places where the problem is. If you don't see JmeContext then you haven't imported the right package. Press Ctrl-Shift-i

Thanks for the Ctrl-Shift-i tip, that fixed the ‘JmeContext’ error.



Regarding instantiating ServerMain, I copied that code from the SpiderMonkey networking tutorial, so I suppose it was intentional.

@artxuleta said:
Thanks for the Ctrl-Shift-i tip, that fixed the 'JmeContext' error.

Regarding instantiating ServerMain, I copied that code from the SpiderMonkey networking tutorial, so I suppose it was intentional.


But usually in main() you would instantiate YOUR class. It sounds like you are pretty new to Java. I would offer that learning a language at the same time as trying to learn 3D networked game programming is going to be pretty difficult. You might want to start with a simpler idea until you know Java better.

Not gonna lie, the last time I did anything Java was when I took a college-level class around a year ago, so I’m pretty rusty.

Okay got it working… LOL.