在文件中传递具有空间字符的JVM参数

时间:2018-03-22 08:48:21

标签: java linux jvm

我在运行run.sh脚本时遇到错误"Error: Could not find or load main class %l"",,我有一个解决方案,用"%h %l"替换---run.sh--- JVM_OPTIONS=`tr '\n' ' ' < ${APP_HOME}/bin/app.jvm.properties` COMMAND_PATH="${JAVA_HOME}/bin/java ${JVM_OPTIONS} -jar APP.jar" ${JAVA_HOME}/bin/java ${JVM_OPTIONS} -jar APP.jar 之间的空格char,例如&#34;%h-%l& #34;

有趣的是,当我在命令行上运行确切的路径(COMMAND_PATH)时,一切都很好。 似乎在文件中传递具有空格字符的JVM参数会导致问题。

你对这个有什么解决方案和建议吗?

存储在app.jvm.properties文件

中的JVM参数

-Dserver.tomcat.access-log-pattern =&#34;%h%l&#34;

from py2neo import NodeSelector,Graph,Node,Relationship
graph = Graph('http://127.0.0.1:7474/db/data')
tx = graph.begin()
selector = NodeSelector(graph)
node_cache = {}

with open("file","r") as relations:
    for line in relations:
        line_split=line.split(";")

        # Check if we have this node in the cache
        if line_split[0] in node_cache:
            node1 = node_cache[line_split[0]]
        else:
            # Query and store for later
            node1 = selector.select("Node",unique_name=line_split[0]).first()
            node_cache[line_split[0]] = node1

        if line_split[1] in node_cache:
            node2 = node_cache[line_split[1]]
        else:
            node2 = selector.select("Node",unique_name=line_split[1]).first()
            node_cache[line_split[1]] = node2

        rs = Relationship(node1,"Relates to",node2)
        tx.create(rs)

tx.commit()

0 个答案:

没有答案