Build from source

I would like to help contribute but am having some issues building for android. I am using netbeans. Is it better for me to use JMP instead?



I’ve got the svn connected in netbeans and I can do a clean / build with the files straight from the repository. However, in order to setup for android, I tried to follow the instructions in https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:build_jme3_sources_with_netbeans



When I add srcandroid and remove srcdesktop and srcdesktop-fx I get a bunch of errors that indicate that the android.jar file is not included in the library. Then I added the android.jar from the lib/android directory using the project properties page (Add JAR/Folder).



At that point I get some errors indicating the some classes can’t be found. Some of the errors are:



C:UserspotterecDocumentsNetBeansProjectsjme3srccorecomjme3appApplication.java:51: cannot find symbol

symbol : class JmeCanvasContext

location: package com.jme3.system

import com.jme3.system.JmeCanvasContext;



C:UserspotterecDocumentsNetBeansProjectsjme3srcandroidcomjme3assetAndroidAssetManager.java:40: cannot find symbol

symbol : class ClasspathLocator

location: package com.jme3.asset.plugins

import com.jme3.asset.plugins.ClasspathLocator;



C:UserspotterecDocumentsNetBeansProjectsjme3srcandroidcomjme3assetAndroidAssetManager.java:48: cannot find symbol

symbol: class DesktopAssetManager

public class AndroidAssetManager extends DesktopAssetManager {



C:UserspotterecDocumentsNetBeansProjectsjme3srcandroidjme3testandroidTestAmbient.java:40: cannot find symbol

symbol : class DesktopAssetManager

location: package com.jme3.asset

import com.jme3.asset.DesktopAssetManager;



C:UserspotterecDocumentsNetBeansProjectsjme3srclwjgl-oglcomjme3systemlwjglLwjglCanvas.java:36: cannot find symbol

symbol : class JmeCanvasContext

location: package com.jme3.system

import com.jme3.system.JmeCanvasContext;



C:UserspotterecDocumentsNetBeansProjectsjme3srclwjgl-oglcomjme3systemlwjglLwjglCanvas.java:51: cannot find symbol

symbol: class JmeCanvasContext

public class LwjglCanvas extends LwjglAbstractDisplay implements JmeCanvasContext {



C:UserspotterecDocumentsNetBeansProjectsjme3srcblendercomjme3scenepluginsblendertexturesImageLoader.java:39: cannot find symbol

symbol : class AWTLoader

location: package com.jme3.texture.plugins

import com.jme3.texture.plugins.AWTLoader;



I assume there is more to the setup than what I did. Does anyone know what steps I haven’t done?



Thanks.

You don’t need to do anything but call ant jar to create the jMonkeyEngine3.jar for android, its created in the dist/opt/android folder.

I understand. What i do now is include the src/android folder to make my changes in netbeans, then remove the src/android folder and do a “clean and build” in netbeans. That seems to work. The only issue is that while I’m working in IDE editing the android files, its complaining about files being missing because I removed the desktop folder. If I leave the desktop folder included, the IDE complains about some duplicate classes. I was hoping to be able to use the “clean and build” function within netbeans or jmp to compile the android jar. I thought that was what the instructions in the wiki was trying to accomplish. I’ll try to work out the instructions to make this work.

I was able to do a “clean and build” from within NetBeans by following these steps:

  1. Download the sources from the Subversion
  2. Add ~/lib/android/android.jar library

    Project Properties->Libraries->Add JAR/Folder
  3. Add source folder ~/src/android

    Project Properties->Sources->Add Folder in Source Package Folder area
  4. Delete the file ~/src/desktop/com/jme3/system/JmeSystem.java from the tree



    Without the Desktop and Desktop-FX folders, the “clean and build” fails due to files missing. With Desktop and Desktop-FX included, the “clean and build” fails due to a duplicate class (JmeSystem.java in Desktop/com/jme/system and in Android/com/jme/system).



    I don’t like how I deleted the file in the desktop/com/jme/system folder.



    Does anyone know how to exclude an individual file from a sources folder in NetBeans so I can simply not include the file instead of deleting it?

Don’t include the “desktop” folder, its only for desktop platforms. Android is not a desktop platform I am afraid.