Cant import com.jme [Solved]

i was able to download jME using eclipse, then i successfully compiled using ant



after, i tried to follow the tutorial, and got this simple app


import com.jme.app.SimpleGame;
import com.jme.scene.shape.Box;
import com.jme.math.Vector3f;
/**
 * Started Date: Jul 20, 2004<br><br>
 * Simple HelloWorld program for jME
 *
 * @author Jack Lindamood
 */
public class HelloWorld extends SimpleGame{
 public static void main(String[] args) {
  HelloWorld app = new HelloWorld(); // Create Object
  // Signal to show properties dialog
  app.setDialogBehaviour(SimpleGame.ALWAYS_SHOW_PROPS_DIALOG);
  app.start(); // Start the program
 }
 protected void simpleInitGame() {
  // Make a box
  Box b = new Box("Mybox", new Vector3f(0,0,0), new Vector3f(1,1,1));
  rootNode.attachChild(b); // Put it in the scene graph
 }
}



but i get the following errors when i try to compile

11 errors found:
File: C:Documents and SettingsBenoitworkspaceHelloWorld.java  [line: 1]
Error: C:Documents and SettingsBenoitworkspaceHelloWorld.java:1: package com.jme.app does not exist
File: C:Documents and SettingsBenoitworkspaceHelloWorld.java  [line: 2]
Error: C:Documents and SettingsBenoitworkspaceHelloWorld.java:2: package com.jme.scene.shape does not exist
File: C:Documents and SettingsBenoitworkspaceHelloWorld.java  [line: 3]
Error: C:Documents and SettingsBenoitworkspaceHelloWorld.java:3: package com.jme.math does not exist
File: C:Documents and SettingsBenoitworkspaceHelloWorld.java  [line: 10]
Error: C:Documents and SettingsBenoitworkspaceHelloWorld.java:10: cannot find symbol
symbol: class SimpleGame
File: C:Documents and SettingsBenoitworkspaceHelloWorld.java  [line: 14]
Error: C:Documents and SettingsBenoitworkspaceHelloWorld.java:14: cannot find symbol
symbol  : variable SimpleGame
location: class HelloWorld
File: C:Documents and SettingsBenoitworkspaceHelloWorld.java  [line: 15]
Error: C:Documents and SettingsBenoitworkspaceHelloWorld.java:15: cannot find symbol
symbol  : method start()
location: class HelloWorld
File: C:Documents and SettingsBenoitworkspaceHelloWorld.java  [line: 19]
Error: C:Documents and SettingsBenoitworkspaceHelloWorld.java:19: cannot find symbol
symbol  : class Box
location: class HelloWorld
File: C:Documents and SettingsBenoitworkspaceHelloWorld.java  [line: 19]
Error: C:Documents and SettingsBenoitworkspaceHelloWorld.java:19: cannot find symbol
symbol  : class Box
location: class HelloWorld
File: C:Documents and SettingsBenoitworkspaceHelloWorld.java  [line: 19]
Error: C:Documents and SettingsBenoitworkspaceHelloWorld.java:19: cannot find symbol
symbol  : class Vector3f
location: class HelloWorld
File: C:Documents and SettingsBenoitworkspaceHelloWorld.java  [line: 19]
Error: C:Documents and SettingsBenoitworkspaceHelloWorld.java:19: cannot find symbol
symbol  : class Vector3f
location: class HelloWorld
File: C:Documents and SettingsBenoitworkspaceHelloWorld.java  [line: 20]
Error: C:Documents and SettingsBenoitworkspaceHelloWorld.java:20: cannot find symbol
symbol  : variable rootNode
location: class HelloWorld



any clue what im doing wrong/forgot to do?

If you are making your test app in a new project, you may need to link that project to the jME project.

How? ^^;

right click your project.

Properties -> Java Build Path -> Projects -> Add …  < select jME > > Ok -> Ok :slight_smile:

The more i learn, the more i realize how clueless i am T_T



when i click add, i have no option to select from and i there is no browse button  :cry:



and thank you for all the help so far :slight_smile:



edit: i just check my jme folder, and i only have .class file; is that normal?

hmm can you run the test Classes in the jmetest package?



You should be able to select your jme project in the java build path -> projects -> add …  dialog.

hmmm i don't know how to run .class file, but when i try to open them with eclipse i get the following message:



Error opening the editor. (Time of error: January 27, 2008 1:44:56 PM EST)

Reason:

The Class File Viewer cannot handle the given input.

hmm no you should run the .java file, right click any jmetest.Test*.java file  and Run As -> Java Application.



But you might be better off creating a few simple non-jme HelloWorld programs in Eclipse first, to get more familiar with the IDE.



It seem you have not much experience with Java/eclipse yet.

yeah i used to use Dr.Java ^^, but the problem is that i have no .java class in my jmetest folder/subfolder :S

as a matter of fact i have no jmetest/test  :’(

You compiled using ant, that might be where all the confusion is happening. I suggest you checkout jME directly from CVS and let Eclipse build it itself.



Follow the instructions in the Getting Started Guide: http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_eclipse_to_build_jme

Yeah! It works! :smiley:

ty for the help everyone

<mode type=arrogant>Cool, I just budge in, and it works  :P  :smiley: </mode>



Now, seriously, I suggest using the wiki a lot. There are a lot of resources there that you can use to aid you in your jME quest.