Coder Social home page Coder Social logo

nudge4j's Introduction

nudge4j is a tiny piece of code to help great developers understand code better, debug less, have more fun.

Overview

With nudge4j you can:

  • control your Java application from the browser, as if the browser was a smarter remote control.
  • send code from the browser to run on the JVM,
  • experiment with live code.

To use nudge4j, just add less than 10 lines of code in your program.

nudge4j in action]

Issues

Report any issue using GitHub and use notifications to track progress on them.

Contributing

Want to hack on this project? Any kind of contribution is welcome! But I am particularly interested in Nashorn/JavaScript samples to add in the example section.

License

This project is licensed under the MIT license.

nudge4j's People

Contributors

lorenzoongithub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nudge4j's Issues

"get all classes" doesen't work - gives FileNotFoundException

I get
The link points to http://localhost:5050/js?code=load(%27https%3A%2F%2Florenzoongithub.github.io%2Fnudge4j%2Ftwigs%2Fget.all.classes.js%27)%3BgetAllClasses(%7BskipJDK%3Afalse%7D)

err::java.lang.RuntimeException: java.io.FileNotFoundException: https://lorenzoongithub.github.io/nudge4j/twigs/get.all.classes.js
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:397)
at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:117)
at jdk.nashorn.internal.runtime.linker.JSObjectLinker.jsObjectScopeCall(JSObjectLinker.java:238)
at jdk.nashorn.internal.scripts.Script$17$^eval_.:program(:1)

obfuscated base64 code looks malicious

Ciao Lorenzo!
Thanks for sharing nudge4j which is a pretty cool idea!
Me and my friends were discussing about the implication of the copy-pasting base64 code into an application as shown in https://lorenzoongithub.github.io/nudge4j.
I found your gist showing (probably) the same code not encoded:

/** nudge4j **/
{
    int      nudge4j_port = 8080; /* http port for Nudge Server */
    Object[] nudge4j_args = {}; /* optional arguments here {} */
    try {
        java.net.URLClassLoader nudge4j_loader = new java.net.URLClassLoader(
            new java.net.URL[] { new java.net.URL("http://nudge4j.appspot.com/onthecloud/nudge4j.jar") });
        nudge4j_loader.loadClass("nudge4j.HttpServer").getMethod("start", int.class, Object[].class)
            .invoke(null, nudge4j_port, nudge4j_args);
        nudge4j_loader.close();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
/** end nudge4j **/

so essentially your code spawn the webserver and execute the content of the remot jar http://nudge4j.appspot.com/onthecloud/nudge4j.jar

How comes you have decided to suggest to copy paste the Base64 code instead of the plaintext version?
What about posting plaintext code and sharing the jar on public (free for open-source project) maven repository?

Not usable to inspect a running application - no non-JVM classes seems to be available

I have tried a lot but I can't access any of my own classes from nudge4j.

That makes it useless to inspect a running application - which is what I got the impression would be possible.

Even though I have lots of classses available on the class path:
http://localhost:5050/js?code=java.lang.System.getProperty(%27java.class.path%27)

I still cant instantiate them, and the (repaired) 'get all classes (exclude JDKs)' links
http://localhost:5050/js?code=load(%27https%3A%2F%2Florenzoongithub.github.io%2Fnudge4j%2Ftwigs%2Fdump.all.classes.js%27)%3BdumpAllClasses(%7BskipJDK%3Atrue%7D)

returns
[Total:0]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.