Newbe start

Hello together,



maybe there is someone that may help me.

I want to jumpstart into jme but I struggled with the setup:



Currently installed is

  • WinXP SP3
  • Eclipse (last recent version 3.4.2)
  • TortoiseSVN (last recent version 1.6.2)



    One question:

    What to do to get a basic project running ? Goal: To have an APPLET in the end displying some 3d graphics.



    REALLY RUNNING sample code available ?



    Thanks even for little help!



    Best regards

    /HB

The wiki has tutorials on getting jME set up. Once you have it, there is a package jmetest with tons of working example code.



Is there a specific problem that’s holding you up?

Alric said:

Is there a specific problem that's holding you up?


Yes, unfortunately I am unskilful with setting up eclipse. I tried to follow some descriptions found here but failed because of different reasons:
* Sometimes it seems that the linux installation is used
* ANT setup should be done (how?)
* The descriptions at all seem to be inaccurate in several meanings (old eclipse version?)

I have downloaded the svn tree of the engine.

And now I need to generate a project within eclipse which has no unsolved bindings, errors or whatever.

Does someone have eventually a stripped down project framework - with maybe only the init and an empty game loop ... which I can directly use by IMPORT into eclipse ?

... ugent help needed ...

Hi Hardbreaker,



maybe this zipped project could be useful…



it contains an Eclipse project with all the necessary

libs needed to compile and run the provided example class.



Ok, some goodies: the provided Ant file could be used to:


  • build the application jar
  • build the junit test classes jar (see src/test directory - there is an example junit class)
  • execute junit test suite and create junit report and emma code coverage report
  • create javadoc with a nice custom doclet



    Let me know if this works for you.


Hi foxat,



thanks a lot for reacting so fast !!!





I got the following result on the console:



14.05.2009 15:31:30 com.jme.app.BaseGame start

INFO: Application started.

14.05.2009 15:31:30 com.jme.system.PropertiesGameSettings <init>

INFO: PropertiesGameSettings created

14.05.2009 15:31:30 com.jme.system.PropertiesGameSettings load

WARNUNG: Could not load properties. Creating a new one.

14.05.2009 15:31:30 class org.foo.bar.CreateObject start()

SCHWERWIEGEND: Exception in game loop

java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

at java.lang.ClassLoader.loadLibrary(Unknown Source)

at java.lang.Runtime.loadLibrary0(Unknown Source)

at java.lang.System.loadLibrary(Unknown Source)

at org.lwjgl.Sys$1.run(Sys.java:72)

at java.security.AccessController.doPrivileged(Native Method)

at org.lwjgl.Sys.doLoadLibrary(Sys.java:65)

at org.lwjgl.Sys.loadLibrary(Sys.java:81)

at org.lwjgl.Sys.<clinit>(Sys.java:98)

at org.lwjgl.opengl.Display.<clinit>(Display.java:129)

at com.jme.system.lwjgl.LWJGLPropertiesDialog$ModesRetriever.run(LWJGLPropertiesDialog.java:682)

at com.jme.app.AbstractGame.getAttributes(AbstractGame.java:252)

at com.jme.app.BaseGame.start(BaseGame.java:67)

at org.foo.bar.CreateObject.main(CreateObject.java:34)

14.05.2009 15:31:30 com.jme.app.BaseSimpleGame cleanup

INFO: Cleaning up resources.

14.05.2009 15:31:30 com.jme.system.lwjgl.LWJGLDisplaySystem <init>

INFO: LWJGL Display System created.

14.05.2009 15:31:30 com.jme.app.BaseGame start

INFO: Application ending.









Building with right click on "build.xml" and "run as/1 Ant build" brings following error:

Buildfile: D:ProjectsEclipseJavaQoodexbuild.xml

clean:

  [delete] Deleting directory D:ProjectsEclipseJavaQoodexdist

init:

    [mkdir] Created dir: D:ProjectsEclipseJavaQoodexdist

    [mkdir] Created dir: D:ProjectsEclipseJavaQoodexdistclasses_test

    [mkdir] Created dir: D:ProjectsEclipseJavaQoodexdistclasses

    [mkdir] Created dir: D:ProjectsEclipseJavaQoodexdistclasses_instrumented

    [mkdir] Created dir: D:ProjectsEclipseJavaQoodexdistreportjunit

    [mkdir] Created dir: D:ProjectsEclipseJavaQoodexdistreportemma

    [mkdir] Created dir: D:ProjectsEclipseJavaQoodexdistreportemmasrc

    [mkdir] Created dir: D:ProjectsEclipseJavaQoodexdistreportfindBugs

    [mkdir] Created dir: D:ProjectsEclipseJavaQoodexdistreportpmd

build.main:

_javac:

    [echo]

    [echo] ================================================================================

    [echo] Compiling application classes …

    [echo] ================================================================================

    [echo]  compile src:      D:ProjectsEclipseJavaQoodexsrcmain

    [echo]  output classes:  D:ProjectsEclipseJavaQoodexdistclasses

    [echo]  output jar:      D:ProjectsEclipseJavaQoodexdist/jmeStartProject.jar

    [echo]  classpath refid:  classpath.common

    [echo]

    [echo]  debug:            true

    [echo]  nowarn:          true

    [echo]  optimize:        off

    [echo]  verbose:          false

    [echo]   

    [javac] Compiling 1 source file to D:ProjectsEclipseJavaQoodexdistclasses



BUILD FAILED

D:ProjectsEclipseJavaQoodexbuild.xml:88: The following error occurred while executing this line:

D:ProjectsEclipseJavaQoodexconfantcompilation.xml:46: Error running javac.exe compiler



Total time: 297 milliseconds

You should execute the example class inside the eclipse IDE, because it contains the correct settings for the classPath and lwjgl native library.

lwjgl is a Java wrapper + native OS library for the OpenGL implementation provided by your OS / gfx driver.

See the Eclipse .classpath file: it points to the win32 implementation

Ooops… ok, it seems you are working with Windows, so this setting should be ok …



<classpathentry kind="lib" path="lib/lwjgl/lwjgl.jar">
  <attributes>
    <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="jmeStartProject/lib/lwjgl/native/windows"/>
    </attributes>
</classpathentry>



Anyway, to change / reset this setting (if you are using linux or a mac), read the "Configure the jME Project" chapter @
http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_eclipse_to_build_jme

So, inside Eclipse:

a) select the CreateObject java class from Package Explorer
b) click the right mouse button
c) "Run As" / "Java application"

Provided Ant file is used only to compile and create the application jar ... not to run its classes  :D

add this to the build.xml file:



<!--
   -  Execute the class specified by ${targetClass} property
   -->
<target name="execute">
  <property name="targetClass" value="org.foo.bar.CreateObject"/>
  <property name="targetOS"    value="windows"/>

  <java
    fork         = "true"
    classpathref = "classpath.test"
    classname    = "${targetClass}">
    <jvmarg value="-Djava.library.path=${basedir}/lib/lwjgl/native/${targetOS}/"/>
  </java>
</target>



from the shell (cmd.exe):


ant build execute



OK - thank you very much!!!



It runs now - not as an applet but as a full screen application.



As I am new here in this field I have made several mistakes:



First: I only have the normal JAVA jre6 installed.

This was the reason why I couldn't get ANT running. It always told me that "tools.jar" was not found. On my whole system was no "tools.jar". Then I realized that I sould download and install the development thing. I installed the latest version which is now "jdk1.6.0_13" and voil

hardbreaker said:

First: I only have the normal JAVA jre6 installed.
This was the reason why I couldn't get ANT running. It always told me that "tools.jar" was not found.


yes, the jre doesn't provide the javac compiler (javac executable and tools.jar library). The full JDK does.

P.S.
I suggest you to spend a bit of time with Eclise IDE before to start with jme...  this could simplifying the things a bit ...

Good work !