Skip to content

Unable to find JavaSybaseLink.jar using process.env.PWD #8

@6harat

Description

@6harat

process.env.PWD is domain specific and might not return the correct value everywhere and is also assuming that the main/index.js of an application would be present at the same level as the node_modules folder.

var PATH_TO_JAVA_BRIDGE1 = process.env.PWD + "/node_modules/sybase/JavaSybaseLink/dist/JavaSybaseLink.jar";

When I was trying to run it on windows, the process.env.PWD was returned as undefined.

As you have already put a comment in the src code over that line,
//FIXME: this is bad should be a way to expose this jar file in the npm package
//so that it can be called properly from parent packages.

I would suggest using the following syntax:
var path = require("path");
var PATH_TO_JAVA_BRIDGE1 = path.join(__dirname, "..", "/JavaSybaseLink/dist/JavaSybaseLink.jar");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions