1

Node JS 应用程序在 Linux、windows 和 Solaris 上运行良好。但是 Node JS 不能在 SPARC 系统中运行,因为它不支持 V8 引擎。

我自己找到了一个名为 AVATAR 的外部项目,它用于使用 JAVA 8 内置的 JavaScript 引擎 - Nashron 在 JVM(Java 虚拟机)中运行 NODE JS 程序。

在他们的官方网站上,他们为我提供了适用于 Linux 的 (.so) 文件和适用于 Windows 的 (.dll) 文件,使用我们编译的程序。通过使用这些文件(.so 和 .dll),我们成功地在 Linux、带有 JAVA 8 的窗口中执行了 Node JS 程序。

我使用相同的 linux (.so) 文件在 SPARC 平台上运行,它会抛出以下错误。

发生了错误 :

-bash-4.1$ java -Djava.library.path=dist -jar dist/avatar-js.jar HttpServer.js

Exception in thread "main" java.lang.UnsatisfiedLinkError: /export/home/thiru/LinuxAVatar/dist/libavatar-js.so: ld.so.1: java: fatal: /export/home/thiru/LinuxAVatar/dist/libavatar-js.so: wrong ELF data format: ELFDATA2LSB (Possible cause: endianness mismatch)

        at java.lang.ClassLoader$NativeLibrary.load(Native Method)

        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)

        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854)

        at java.lang.Runtime.loadLibrary0(Runtime.java:870)

        at java.lang.System.loadLibrary(System.java:1122)

        at com.oracle.libuv.LibUV.<clinit>(LibUV.java:33)

        at com.oracle.avatar.js.Server.<init>(Server.java:166)

        at com.oracle.avatar.js.Server.<init>(Server.java:140)

        at com.oracle.avatar.js.Server.<init>(Server.java:128)

        at com.oracle.avatar.js.Server.main(Server.java:122)

我在 NODE JS 中附加了基本的 HTTP 服务器程序,我曾经使用 avatar 在 JVM 中运行该程序。

您能否为以下几点提供一些可行性:

1.在SPARC系统上运行NODE JS,

2.SPARC的.so文件是否有任何构建,

3. 我应该在 SPARC 中使用任何其他 Java 脚本引擎而不是 Nashron(例如:Spider Monkey)。

官网链接:https ://avatar-js.java.net/

运行 Avatar 的程序:http: //blog.jonasbandi.net/2014/03/running-nodejs-applications-on-jvm-with.html

Oracle Solaris OS 版本:Oracle Solaris 11.3 SPARC

JAVA 版本:java 版本“1.8.0_60”Java(TM) SE 运行时环境(构建 1.8.0_60-b27)Java Hotspot(TM) 64 位服务器 VM(构建 25.60-b23,混合模式)

提前致谢。

var http = require('http');

var server = http.createServer(function (request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.end("Hello World\n");
});

server.listen(8000);
console.log("Server running at http://127.0.0.1:8585/");
4

1 回答 1

1

来自 Oracle 的 Project Avatar 已经死了。
官方称它为“开发暂停”,但是……你知道的!
另请参阅我的博文:http
://www.nk.de/2015/02/current-status-of-oracles-project-avatar.html 提到的替代“Nodyn”也已死。

因此,您必须寻找另一个选项来在您想要的平台上运行 node.js。

于 2017-05-23T05:42:54.123 回答