Importing an Eclipse Project into JME

I’m trying to import an eclipse project that has all of my java code into JME, but it’s not letting me. I select import eclipse project from the drop down menu, select my workspace, it okay’s it, and then asks me to select which project I want to use. I click on the checkbox next to the “Arena” project which is the one I want to import, but it never actually checks the box. All it does when I click the box is highlight the name and it does not let me proceed saying that I need to at least select one project. It also says that my project is an unknown project type despite me specifying it as a Java project when it was created in Eclipse. Under eclipse’s project properties it details the project as using java natures, compilers etc. If you have any suggestions I would be very grateful. Thank you for your time.

Here’s a screenshot of the problem:

Just create a new BasicGame project and copy over your code into the src/ directory and your assets into assets/, then specify the new main class in the settings. Thats probably the easiest way.

1 Like

I copied the code over but I looked every where and could not find where I specify the main class. Do you mind pointing me in the right direction?

Right-click the project and select “preferences”. The SDK has a manual, press F1.

1 Like

Found it, thanks. I don’t have any models yet but I use a few images for the background of my title panel and for a few ability tooltip’s backgrounds. In eclipse I had them in the same folder with the rest of my java files, and that’s how the code gets these images:

[java]URL url = getClass().getResource("/background.jpg");

panel = new ImagePanel(new ImageIcon(url).getImage());[/java]

In JME, when the program is run, it does not show these images and throws an exception. If I put them under assets, there’s no appropriate folder for these flat images, there’s only folders for models, 3D scenes etc. Where should I put the images so they will load properly or how should I alter my java code so that it will allow JME to read the files? Thanks.

Well if you want to keep the flat structure just put them in the assets folder root, it’s added to the classpath of the project and later the assets.jar that is created from it is also added to the classpath. I’d suggest putting the assets in folders though as you will quickly run into situations where you have multiple “background.jpg” files and the systems could not distinguish them anymore.

Yea, that worked, thanks.