Deps: OpenJDK 15, failureaccess-1.0.1, groovy-jsr223-4.0.2, guava-31.1-jre, lemur-1.16.0-javadoc, sio2-1.7.0-javadoc, slf4j-api-2.0.0-alpha7-sources (macOS 11.6.5). Are these ok?
This shows in a window:
Error in application:
Uncaught exception thrown in Thread[jME3 Main,5,main]
NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException
Could it be related to[ my issue](https://hub.jmonkeyengine.org/t/illegal-reflective-access-warning/45603/4)
about illegal reflective access?
The error is here as well.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jme3.util.ReflectionAllocator (file:/Users/erik/Documents/Dev/jME3/lib/jme3-core.jar) to method sun.nio.ch.DirectBuffer.cleaner()
Code, this time I tried [creating a ui](https://github.com/jMonkeyEngine-Contributions/Lemur/wiki/Getting-Started)
(not sure I installed all dependencies correctly).
public class ClientWindow extends SimpleApplication {
private boolean isRunning = true;
protected Geometry player;
@Override
public void simpleInitApp() {
Box b = new Box(1, 1, 1);
player = new Geometry("Player", b);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Blue);
player.setMaterial(mat);
rootNode.attachChild(player);
initKeys(); // load my custom keybinding
//GUI
// Initialize the globals access so that the default
// components can find what they need.
GuiGlobals.initialize(this);
// Load the 'glass' style
BaseStyles.loadGlassStyle();
// Set 'glass' as the default style when not specified
GuiGlobals.getInstance().getStyles().setDefaultStyle("glass");
Container ourWin = new Container();
guiNode.attachChild(ourWin);
ourWin.setLocalTranslation(200, 200, 0);
ourWin.addChild(new Label("Items: "));
Button button = ourWin.addChild(new Button("quit"));
button.addClickCommands(new Command<Button>() {
@Override
public void execute(Button source) {
System.out.println("Quit button pressed.");
}
});
}
private void initKeys() {
// You can map one or several inputs to one named action
//inputManager.deleteMapping( SimpleApplication.INPUT_MAPPING_MEMORY );
inputManager.addMapping("Up", new KeyTrigger(KeyInput.KEY_W),
new KeyTrigger(KeyInput.KEY_UP));
inputManager.addMapping("Left", new KeyTrigger(KeyInput.KEY_A),
new KeyTrigger(KeyInput.KEY_LEFT));
inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_D),
new KeyTrigger(KeyInput.KEY_RIGHT));
inputManager.addMapping("Down", new KeyTrigger(KeyInput.KEY_S),
new KeyTrigger(KeyInput.KEY_DOWN));
// Add the names to the action listener.
inputManager.addListener(actionListener, "Up", "Left", "Right", "Down");
// inputManager.addListener(analogListener, "Up", "Left", "Right", "Down");
}
private final ActionListener actionListener = new ActionListener() {
@Override
public void onAction(String name, boolean keyPressed, float tfp) {
if(isRunning){
float value=0.4f;//arbitrary offset for now.
if (name.equals("Up") && !keyPressed ) {
Vector3f v = player.getLocalTranslation();
player.setLocalTranslation(v.x, v.y + value /** speed*/, v.z);
}
if (name.equals("Down")&& !keyPressed) {
Vector3f v = player.getLocalTranslation();
player.setLocalTranslation(v.x, v.y - value /** speed*/, v.z);
}
if (name.equals("Right")&& !keyPressed) {
Vector3f v = player.getLocalTranslation();
player.setLocalTranslation(v.x - value /** speed*/, v.y, v.z);
}
if (name.equals("Left")&& !keyPressed) {
Vector3f v = player.getLocalTranslation();
player.setLocalTranslation(v.x + value /** speed*/, v.y, v.z);
}
}
}
};
@Override
public void simpleUpdate(float tpf) {
//TODO: add update code
}
}