News for hackers. Stuff that matters.
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by swiley on Friday July 14, 2017 @09:38AM (#14769666)
Now you can just shove this in electron and have java apps everywhere again!
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by fenwick67 on Friday July 14, 2017 @01:26PM (#14771506)
Then run the Electron application in the browser with Emscripten
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by benjismith on Friday July 14, 2017 @02:09PM (#14771927)
Awesome! I'm very excited about this...

As the primary developer of a large sophisticated Javascript app (https://shaxpir.com), working with Javascript is an ongoing nuisance, and I'd love to switch the majority of my development to a type-safe language.

I've been considering a switch to TypeScript, but with 17 years of experience as a back-end Java developer, my natural first-choice of language is Java.

But this is a modern webapp, so I'm not really interested in seeing Console/Swing/AWT demos. I'm much more interested in seeing demos that integrate Java code with native Javascript dependencies, especially around DOM manipulation and browser event handling.

I want to rewrite all my own business logic in Java, while continuing to integrate with my existing dependencies in the browser (JQuery, Bootstrap, Quill, etc).

A demo like that would be very compelling to me!

Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by multimillion on Friday July 14, 2017 @03:06PM (#14772359)
Hello Benji!

Please get in touch with us, your project is very exciting and would be a great use case for CheerpJ. Just drop us a line at http://leaningtech.com/cheerpj/#early.

CheerpJ has full DOM access and interoperability with JavaScript. Demos of these case study will be coming soon.

Cheers - LT

Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by jay-anderson on Friday July 14, 2017 @03:40PM (#14772589)
Seems to work pretty well. I like this approach over things like GWT. Though creating a syntax error caused a bad exception:

  public class JavaFiddle
  {
      public static void main(String[] args)
      {
          x = 0;
      }
  }
Results in

  An exception has occurred in the compiler (1.8.0_131). 
  Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
  java.lang.NullPointerException
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by murkle on Friday July 14, 2017 @09:06AM (#14769463)
Wow, good job! The CheerpJ Chrome Extension to run old Java Applets actually works, eg http://dogfeathers.com/java/octicos.html
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by feikname on Friday July 14, 2017 @08:13AM (#14769155)
If you don't see any "compile and run" button or the text console, you may need to zoom out or go fullscreen. That was my case on Firefox 54 with a 1366x768 screen.
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by RegW on Friday July 14, 2017 @03:16PM (#14772410)
I don't anticipate ever using AWT or Swing again. JavaFX would get me interested but I don't see it mentioned. How feasible would that be?
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by fullstackhuman on Friday July 14, 2017 @08:13AM (#14769159)
The boilerplate HelloWorld code hangs on `compiling...` for me. Not sure if it's my network ad-blocker or something else though.
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by multimillion on Friday July 14, 2017 @08:18AM (#14769184)
Hello there. Can you share your browser and OS? We can't replicate this here. - LT
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by biowaffeln on Friday July 14, 2017 @10:03AM (#14769845)
Same here. Worked after I deactivated my addblocker (uBlock Origin)
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by plod on Friday July 14, 2017 @11:05AM (#14770312)
same here using privoxy
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by brian_herman on Friday July 14, 2017 @12:27PM (#14771056)
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by invalidname on Saturday July 15, 2017 @09:14AM (#14776484)
Besides the Swing/AWT support which isn't very interesting to me how do you compare to teavm?

We currently use TeaVM and it's pretty performant/small.

Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by Alupis on Friday July 14, 2017 @11:57AM (#14770780)
Obviously not a problem with the platform, but your example Java code doesn't really use standard Java conventions. A bit odd for samples usually.
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by _pmf_ on Friday July 14, 2017 @08:19AM (#14769187)
Horizontal non-resizability of the editor is a bit of an issue (Chrome / Win7).
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by multimillion on Friday July 14, 2017 @08:23AM (#14769199)
You are right of course. This will keep improving over time, especially on the HTML side of things. We'll keep your comment in mind. Cheers - LT
Re:Show HN: CheerpJ JavaFiddle – Run Java in the browser by bitmapbrother on Friday July 14, 2017 @02:49PM (#14772248)
This is seriously cool. Who needs a REPL when you can just use this.