pjBooms / Java-ReStart

New deployment model for Java applications: instant delivery of Java applications via Internet as they were web applications
GNU General Public License v3.0
20 stars 4 forks source link

Easy-to-try jar #2

Closed ReDetection closed 9 years ago

ReDetection commented 9 years ago

Please provide a fat jar/war via github releases feature — it would be faster to try it just from jar than git clone, brew install maven, mvn compile, mcedit pom.xml (to change source to 1.8 because 1.7 throws compilation error), mvn compile, java ... OMGWTF google google gooogle github new issue

pjBooms commented 9 years ago

Thanx for noting about 1.7, I have just corrected the pom.xml.

The server with all demos is already deployed to http://javarestart.com so there is no need to build the war and launch your own Tomcat/Jetty for evaluation/testing purposes.

As to fat .jar for the client, actually I would like to prepare self-contained native packages for WebFX browser (with private JRE) integrated with Java ReStart for all desktop platforms for easy-to-try. But before I do it, it seems to be the good idea to release all-inclusive fat jar. I believe that there must be good maven plugin for it. Please feel free to provide a pool request, if you find a way to build such a jar earlier than me.

Now the easiest way to try the Java ReStart demos is to build and run Java-ReStart demo subproject. Please let me know if you succeed with this.

If you'd like to try WebFX demo enhanced with Java ReStart -- you need to build my WebFX fork first and then javarestart-webfx subproject. Tip to launch: you need to specify the following VM properties before launch WebFX browser: -Djava.protocol.handler.pkgs=javarestart.protocols -Dwebfx.url.handlers=javarestart.webfx.JavaURLHandler,javarestart.webfx.WFXURLHandler

ReDetection commented 9 years ago

Yeah, I tried two plugins for building fat jar (unsuccessful), and I tried to just run javarestart from classes but even failed to pass proper classpath (error was NoClassDefFoundError: org/json/simple/JSONValue but I'm sure json-simple-1.1.jar do exist in classpath). Perhaps, because I haven't used java for too long.

Ok, I'll let you know about any success.

pjBooms commented 9 years ago

json-simple-1.1.jar is within maven dependencies and can be found in maven repository. Actually I run this stuff from IDEs (currently I'm using IDEA) that have good maven support and IDEs automatically add all dependencies to classpath of course.

pjBooms commented 9 years ago

Finally, I was able to create a fat jar for WebFX browser but it is 34MB with all dependencies that Bruno was added to it! He just added Groovy as dependency and voila -- it depends on JRuby ans so on, and you finally get 34MB.

Fortunately, Java ReStart solves this problem! So, I have just released 75K executable jar that runs WebFX browser located remotely. You can find it here: https://github.com/pjBooms/Java-ReStart/releases/tag/v0.1.1-alpha or directly at demo site: http://javarestart.com

Please try it and let me know if it works for you, I will try it as well on different computers at job (but it works on both my PCs at home).

ReDetection commented 9 years ago

Wow, that's amazing! Only a 75K local jar launches a full-featured browser! That's a really awesome! Unfortunately, I can't run any example, interface is silent, and I see stacktrace in the terminal:

Exception in thread "AppKit Thread" java.lang.NullPointerException
    at javafx.fxml.JavaFXBuilderFactory.<init>(JavaFXBuilderFactory.java:121)
    at javafx.fxml.JavaFXBuilderFactory.<init>(JavaFXBuilderFactory.java:87)
    at javafx.fxml.FXMLLoader.<init>(FXMLLoader.java:2054)
    at webfx.WebFXView.internalLoad(WebFXView.java:168)
    at webfx.WebFXView$$Lambda$313/1923141899.run(Unknown Source)
    at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292)
    at com.sun.javafx.application.PlatformImpl$$Lambda$54/341217862.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291)
    at com.sun.javafx.application.PlatformImpl$$Lambda$53/943079405.run(Unknown Source)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

I'm using OS X Yosemite. What kind of info could help you?

$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
ReDetection commented 9 years ago

Seems like I need the BIG STAR button on the github!

pjBooms commented 9 years ago

Great!

It seems to be some security problem (according to the stack trace). Did you run it via Finder or from terminal via "java -jar JavaRestart.jat"?

It does not work for me when I double click from the finder on the jar and works if I run the jar manually from terminal -- it seems that launching via finder installs some restricted security manager.

Probably Yosemite has stricter security checks (or particular 25 update) -- I will check it tomorrow.

ReDetection commented 9 years ago

I did it from the terminal — that's how I got stacktrace. Actually, I can run it from finder too and it's working fine except for fxml pages browser shows nothing — like it did from terminal.

I have some options in the system preferences app, but can't see there any strict setting. Every option is set to prompt me.

pjBooms commented 9 years ago

Ok. I have reproduced the issue. I will try to fix it soon.

pjBooms commented 9 years ago

Finally, it proved to be a bug in Java for Mac OSX introduced in some Java 8 micro version (I have jdk 8 u 5 and there is no such a bug there). I was able to workaround it for WebFX browser: so now you should be able to run the samples (I updated the WebFX browser on the server so you do not need new jar to launch it). Please let me know if it works for you now.

Unfortunately, the bug manifests itself on some other JavaFX samples, and it requires more time to workaround it. Now I use Java instant splash for running standalone apps but it does not work well with JavaFX applications. So I believe I need to use another approach (Java FX based).

pjBooms commented 9 years ago

I believe that the issue regarding NullPointerException does not relate to the original issue. So I close this issue and you may create new ones regarding glicks you observe.

ReDetection commented 9 years ago

FYI: I've just run one more time and it worked. Not sure if it was because of recent java update, but it's cool it's working.