Closed simon-brooke closed 7 months ago
Note that this is a launch after selecting 'run' from the context menu in the projects tab of jMonkeyPlaform 3.6.1-stable. I am trying to build an uberjar for SimArboreal-Editor, but so far have not succeeded.
I'm not sure why you want to make an "uber jar". It's an ancient and frowned-upon practice these days.
As to the other, the error is because of this: "Unable to make private java.lang.Class(java.lang.ClassLoader,java.lang.Class) accessible: module java.base does not "opens java.lang" to unnamed module @6f29c911" ...you have to pass the right command line argument for newer Java to support reflection. Reflection is going to be required for a lot of things in Lemur, JME, etc. that SimArboreal relies on.
I don't have the command line argument handy but will post back later if you haven't found it yet.
Edit: note also that an uber-jar (that includes all dependencies) will fail in this case because it will have trouble combining the lemur (UI) jars together.
To run things that use reflection, I pass the --add-opens argument like in this application config from Mythruna's build.gradle file:
application {
applicationDefaultJvmArgs = [ "-ea", "-Xmx3g", "-Xms512m", "-XX:MaxDirectMemorySize=3g", "--add-opens", "java.base/java.io=ALL-UNNAMED" ]
}
Re: uberjars, if a SimArboreal-Editor uberjar had been built back in 2016 and published somewhere, folk could just download it and run it and evaluate it without having to recompile anything, and you would get
Both of which are good things. If you package an application with all its dependencies, then you have a fair guarantee that it will continue to just work.
However, if I remove the single line BaseStyles.loadGlassStyle();
, thus:
diff --git a/src/main/java/com/simsilica/arboreal/TreeEditor.java b/src/main/java/com/simsilica/arboreal/TreeEditor.java
index 89be342..0696143 100644
--- a/src/main/java/com/simsilica/arboreal/TreeEditor.java
+++ b/src/main/java/com/simsilica/arboreal/TreeEditor.java
@@ -146,7 +146,7 @@ public class TreeEditor extends SimpleApplication {
rootNode.attachChild(geom);
*/
- BaseStyles.loadGlassStyle();
+// BaseStyles.loadGlassStyle();
TreeOptionsState treeOptions = stateManager.getState(TreeOptionsState.class);
treeOptions.addOptionToggle("Grass", stateManager.getState(GroundState.class), "setShowGrass");
I get a successful launch of a window showing a leafless tree, a male character model, a female character model, and what appears to be an editing UI on the left hand side:
This has at present the standard SimpleApplication mouse and keyboard behaviour, so I haven't yet worked out whether I can interact with the UI, but it should be enough to get me started.
re:"Re: uberjars, if a SimArboreal-Editor uberjar had been built back in 2016 and published somewhere, folk could just download it and run it and evaluate it without having to recompile anything, and you would get
More active users; and
Fewer bug reports
" But uber-jars like that have numerous problems because any files that are the same name will fail, meta-inf gets weird, etc... it's ancient maven technology from 20 years ago because maven couldn't figure out how to build an application jar. It also has a problem with command line arguments and stuff. Giant single jars were never a good idea and maven developers should be ashamed of themselves. :)
As to your points, a gradle generated application zip would solve the same problems... and I thought I already published one. Apparently, I only have the older netbeans generated .exe versions: https://github.com/Simsilica/SimArboreal-Editor/tree/master/release
re: "However, if I remove the single line BaseStyles.loadGlassStyle();, thus:"
Yes, because you've disable all Lemur styling support. It would be better to fix your reflection permission problems with the command line argument.
You should only have to edit build.gradle: https://github.com/Simsilica/SimArboreal-Editor/blob/master/build.gradle#L10 ...to look like the line I pasted above. If I get time later then maybe I will try it but we're in a weird place because I'm stuck (for the moment) on gradle 7.
Also, my recollection is that space bar toggles between flight mode and edit mode... but I thought it started in edit mode.
As discussed in [this thread]() on jMonkeyEngine Hub today.
Stacktrace as follows:
I hope you can make some sense of this!