Java Run Nodejs file

Source: Internet
Author: User

Java Run System command https://www.cnblogs.com/bencakes/p/6139477.html

Problem, after the tool is large jar package, cannot find the Nodejs file to run where to put the imported jar to put the Nodejs file or put it in an absolute path

Nodejs encryption and then Java runs

 PackageCom.tool.java;ImportJava.io.BufferedReader;ImportJava.io.InputStreamReader; Public classSha256 {//sha256 Encryption     Public Staticstring encrySha256 (String pass) {string Newpass= ""; if(Pass = =NULL) {            returnNewpass; }        Try{Process P=NULL; BufferedReader stdout=NULL; String Command= "node./sha256.js" +Pass; P=runtime.getruntime (). exec (command); StdOut=NewBufferedReader (NewInputStreamReader (P.getinputstream ()));            String Line;  while(line = Stdout.readline ())! =NULL) {Newpass=Line ;        } stdout.close (); } Catch(Exception e) {}returnNewpass; }}
' Use strict ' xxxxxxxxxxxxxxxxxxxnodejs  encrypted content let Pass;process.argv.foreach (function (val, index) {  if (index = = 2 {  pass = val;  }}); Let Newpass = B (pass) console.log (Newpass)

  

Java Run Nodejs file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.