Coder Social home page Coder Social logo

Comments (1)

angwe avatar angwe commented on April 27, 2024 1

You are using the wrong tool. Nailgun works when you want to run the same java process (including libraries/classes/packages) many times over with different parameters without incurring JVM startup overhead. By its nature, it is keeping one set of libraries/classes/packages the entire time the server is running. I suspect that when you tried to run the second instance of nailgun with a different classpath, it crashed behind the scenes because the port wasn't available. Unless you kill the server with the old classpath and start a new one with the new classpath, asking for the same alias/class each time will keep giving you the first one you loaded.

java ... -cp /path/to/nailgun-server.jar:/path/to/1/ com.facebook.nailgun.NGServer

That's starting your NGServer.

ng HelloWorld

That invokes the "HelloWorld" class from the nailgun server and you get "Hello, world! 1"

java ... -cp /path/to/nailgun-server.jar:/path/to/2/ com.facebook.nailgun.NGServer

That fails to start because there's already a nailgun server running with your default settings and it can't have the TCP port.

ng HelloWorld

That invokes the "HelloWorld" class from the already running nailgun server and you get "Hello, world! 1"

I think that if you were to write a class that uses ClassLoader to pull in each student's code, run the test against it, and output results, you could load that into nailgun and then only have to automate the process of invoking that against each student's class.

java ... -cp /path/to/nailgun-server.jar:/path/to/MyClassLoaderAndTestSuite.jar com.facebook.nailgun.NGServer

ng MyClassLoaderAndTestSuite Student1/HelloWorld.class
ng MyClassLoaderAndTestSuite Student2/HelloWorld.class
...
ng MyClassLoaderAndTestSuite StudentN/HelloWorld.class

I cannot make any recommendations on how to do so, as I am not a Java programmer.

from nailgun.

Related Issues (20)

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.