Errors with HelloWorld.java

Hi all,



Im new to jME2 and i tried to compile the HelloWorld.java, but i get these errors and I dont know what to do:



…/NetBeansProjects/Hello3D/src/hello3d/test/HelloWorld.java:14: hello3d.test.HelloWorld is not abstract and does not override abstract method render() in com.jme.app.AbstractGame

public class HelloWorld extends SimpleGame {

…/NetBeansProjects/Hello3D/src/hello3d/test/HelloWorld.java:18: cannot find symbol

symbol  : variable ConfigShowMode

location: class hello3d.test.HelloWorld

                app.setConfigShowMode(ConfigShowMode.AlwaysShow);



Can somebody help me with this?

Can I ask where you got this HelloWorld tutorial from?  I'm not familiar with it, most of our tutorials are branded as jmetest…

From http://www.jmonkeyengine.com/wiki/doku.php/tutorial_1_-_learning_jme_2



Its weird…i have Netbeans 6.7.1 and i did what the setup tutorial told me to do…:slight_smile:

I just tested out what's on the wiki and that loads the blank scene fine…



Are you using the exact code that's there?  It looks like your classpath is missing some libraries as well… Are you sure all of the jME jar's are there (or that the jME project is setup correctly if you're working off SVN)?

I have no idea what i am missing :stuck_out_tongue:

I have added these jars:




Does anyone know what im missing here??

I also tried to compile from svn…but iv the same problems here.



Oh yeah, im using a mac…



plz can somebody help me??

Ah ok… if you're on mac, remove jme-swt and the third-party swt.jar from your classpath.  jME will function fine but will not support functionality for SWT integration. (Swing and AWT still work)

Ok done that…and still get these errors…:frowning:



no one else have ever had these problems??

Ok,



I also tried to setup eclipse, but i get the same errors and more:



Description Resource Path Location Type

The type HelloWorld must implement the inherited abstract method AbstractGame.update() HelloWorld.java /Hello3d/src line 44 Java Problem

The type HelloWorld must implement the inherited abstract method AbstractGame.render() HelloWorld.java /Hello3d/src line 44 Java Problem

ConfigShowMode cannot be resolved HelloWorld.java /Hello3d/src line 47 Java Problem

Access restriction: The type Vector3f is not accessible due to restriction on required library /Library/Java/Extensions/jme.jar HelloWorld.java /Hello3d/src line 35 Java Problem

Access restriction: The type Vector3f is not accessible due to restriction on required library /Library/Java/Extensions/jme.jar HelloWorld.java /Hello3d/src line 52 Java Problem

Access restriction: The type Vector3f is not accessible due to restriction on required library /Library/Java/Extensions/jme.jar HelloWorld.java /Hello3d/src line 52 Java Problem

Access restriction: The method attachChild(Spatial) from the type Node is not accessible due to restriction on required library /Library/Java/Extensions/jme.jar HelloWorld.java /Hello3d/src line 53 Java Problem

Access restriction: The constructor Vector3f(float, float, float) is not accessible due to restriction on required library /Library/Java/Extensions/jme.jar HelloWorld.java /Hello3d/src line 52 Java Problem

Access restriction: The constructor Vector3f(float, float, float) is not accessible due to restriction on required library /Library/Java/Extensions/jme.jar HelloWorld.java /Hello3d/src line 52 Java Problem



This is really weird, and i really want to use JME…any ideas??

Hey, sorry I haven't gotten back to you :frowning:



I've had this restricted access library problem before and have solved it most times by deleting and reinstalling the JRE&JDK.



I've never had to do this on a mac and am not totally sure how to re-install Java there, so the first thing I would try is removing the JRE from your Eclipse build path and adding it again (I don't think this will work since you had problems in NetBeans as well).



This is how someone reinstalled Java on Leopard, not sure if the same will work for Snow Leopard.  Have you changed any of the Java files on your OS? http://www.macosxhints.com/article.php?story=2009051215025819

Hi,



Thats ok :).

I just reinstalled my mac (my mac didnt work very well anymore) and now it works…so i guess something was wrong with my java files or something…:).



Thanks for all your help :).

Due to the weirdness with Apple-Java its probably best practice to keep all of your own libs away from the Apple implementation… You aren't the first person to run into a problem like this.