badvision / jace

Java Apple Computer Emulator
Apache License 2.0
66 stars 19 forks source link

How to build from source? #2

Closed lifepillar closed 8 years ago

lifepillar commented 8 years ago

How do you build Jace from source? I have tried to build the current master with mvn package: although the build is successful, apparently the manifest is not added to the jar:

java -jar target/jace-2.0-SNAPSHOT.jar 
no main manifest attribute, in target/jace-2.0-SNAPSHOT.jar

What am I missing?

badvision commented 8 years ago

After building there is a target/jfx/app folder which has the jar you are looking for.

lifepillar commented 8 years ago

Thanks, apparently I didn't look hard enough.

I've noticed that the app built from the release archive (https://github.com/badvision/jace/archive/v2.0b.tar.gz) can be run only from the build directory. If the jar is moved anywhere else, the app crashes with:

Exception in Application start method
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/reflections/Reflections
    at jace.core.Utility.<clinit>(Utility.java:170)
    at jace.JaceApplication.start(JaceApplication.java:50)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
Caused by: java.lang.ClassNotFoundException: org.reflections.Reflections
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 8 more
Exception running application jace.JaceApplication

I can build and run without errors from the current master, though.

badvision commented 8 years ago

correct -- the app adds its dependencies via the manifest file. Therefore there is a need for better packaging but I haven't worked on that part yet. Generally when I upload a build I zip up the contents of /target/jfx/app as the root of the zip archive. This helps disambiguate things a little I hope.