I have about 2 different java files and one client file. I want to pass data into the java client file and collect the output using javascript.

For context, my project looks like this. I have a Linear Systems of Equations program. The client file has a method that takes input in the form of a string and filters it for the x coefficient, y coefficient, and result. The second file is a class LinearEquation with fields x coefficient, y coefficient, result, and slope. It has a method that takes another instance of LinearEquation and finds the intersection between both lines (returns the x and y values in an array of length two). If there is no result or infinite results the program returns two values of null. I want to make a website that takes user input using javascript, and then that information is passed into the java files. How can I do this? Is there any software that can help me accomplish this? I'm a beginner at programming so any pointers/tips/tricks you guys have is greatly appreciated!


Your Java would need to be running server side, either as a application server (Tomcat, Websphere etc) where Java runs the entire back end, or you need some other langauge to run the back end that can make shell_exec() type calls to your java program. Either way, client side (via Javascript) can communicate with back end by doing HTTP based calls much like a REST API would do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.