jMonkeyEngine / jmonkeyengine

A complete 3-D game development suite written in Java.
http://jmonkeyengine.org
BSD 3-Clause "New" or "Revised" License
3.78k stars 1.12k forks source link

TestChooser does not show classes list when run with java 8 #1892

Closed Ali-RS closed 1 year ago

Ali-RS commented 1 year ago

From the IDE it works just fine but when I run the JME examples jar file I extracted from jME3.6.0-alpha1.zip (downloaded from https://github.com/jMonkeyEngine/jmonkeyengine/releases/tag/v3.6.0-alpha1) with java 8 it does not show the class list. Running with java 11 and 17 it works fine.

Screenshot_2023-01-05_14-19-26

Ali-RS commented 1 year ago

Further investigating on this I found using java 8, it adds a "/" at the end of the directory name when calling file.getFileName() from a jar file system in this line:

https://github.com/jMonkeyEngine/jmonkeyengine/blob/f0918a4caf4eb592add2221243afb4dfcf13ca28/jme3-examples/src/main/java/jme3test/TestChooser.java#L217-L222

so the constructed class name looks something like jme3test.scenes/.TestControl.class

Here is the result of adding a System.out.print before line 220 that prints the directory name (file.getFileName())

directoryName=scenes/
directoryName=font/
directoryName=materials/
directoryName=gui/
directoryName=export/
directoryName=niftygui/
directoryName=water/
directoryName=batching/
directoryName=post/
directoryName=light/
directoryName=pbr/
directoryName=network/
directoryName=tools/
directoryName=scene/
directoryName=instancing/
directoryName=effect/
directoryName=math/
directoryName=animation/
directoryName=stress/
directoryName=asset/
directoryName=input/
directoryName=combomoves/
directoryName=bounding/
directoryName=texture/
directoryName=ktx/
directoryName=dds/
directoryName=awt/
directoryName=bullet/
directoryName=shape/
directoryName=opencl/
directoryName=model/
directoryName=anim/
directoryName=shape/
directoryName=games/
directoryName=terrain/
directoryName=material/
directoryName=audio/
directoryName=conversion/
directoryName=app/
directoryName=state/
directoryName=renderer/
directoryName=collision/
directoryName=helloworld/

Note that it works fine when running from IDE.

Sailsman63 commented 1 year ago

It also works fine when launching with the gradle build script.