英文:
Is there a way to access Java classes that are not the main method through node.js?
问题
我需要通过node.js访问一个Java算法,该算法对图像进行AES/CBC/PKCS5Padding
加密。我尝试在node.js中重新创建这个逻辑,但有些库只能在Java中找到。
我无法更改.jar文件,只能调用它的方法。
提前感谢!
英文:
I need to access a Java algorithm through node.js that encrypts an image to AES/CBC/PKCS5Padding
. I tried recreating the logic in node.js but there are certain libraries that can only be found in Java
I can't make changes to the .jar file, I can only call it's methods.
Thanks in advance!
答案1
得分: 0
我认为从Node.js代码库到JAR文件的通信是不可能的。如果您想要加密图像,以下模块将有所帮助:
- node-file-encrypt - npm
- file-encryptor - npm
- crypto
英文:
I think that is not possible to communicate from nodejs code base to jar file. if you want to encrypt an image below modules will help.
1.node-file-encrypt - npm
2.file-encryptor - npm
3. crypto
答案2
得分: 0
我已经弄清楚如何做了。所以你可以使用node-jre并使用它来调用.jar文件,设置jar路径和主类
我不得不对原始的.jar文件进行更改,并添加一个主类来调用它。
英文:
just figured how to do it. So we you can use node-jre and use that to call the .jar file by setting the jar path and the main class
I had to make changes in the original .jar file and add a main class to call it
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论