fuseki-server 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #!/bin/sh
  2. # Licensed to the Apache Software Foundation (ASF) under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. The ASF licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. # Run fuseki as a standalone server
  18. export FUSEKI_HOME="${FUSEKI_HOME:-$PWD}"
  19. if [ ! -e "$FUSEKI_HOME" ]
  20. then
  21. echo "$FUSEKI_HOME does not exist" 1>&2
  22. exit 1
  23. fi
  24. JAR1="$FUSEKI_HOME/fuseki-server.jar"
  25. JAR2="$FUSEKI_HOME/jena-fuseki-server-*.jar"
  26. JAR=""
  27. for J in "$JAR1" "$JAR2"
  28. do
  29. # Expand
  30. J="$(echo $J)"
  31. if [ -e "$J" ]
  32. then
  33. JAR="$J"
  34. break
  35. fi
  36. done
  37. if [ "$JAR" = "" ]
  38. then
  39. echo "Can't find jarfile to run"
  40. exit 1
  41. fi
  42. # Deal with Cygwin path issues
  43. cygwin=false
  44. case "`uname`" in
  45. CYGWIN*) cygwin=true;;
  46. esac
  47. if [ "$cygwin" = "true" ]
  48. then
  49. JAR=`cygpath -w "$JAR"`
  50. FUSEKI_HOME=`cygpath -w "$FUSEKI_HOME"`
  51. fi
  52. export FUSEKI_BASE="${FUSEKI_BASE:-$PWD/run}"
  53. if [ -z "$JAVA" ]
  54. then
  55. if [ -z "$JAVA_HOME" ]
  56. then
  57. JAVA=$(which java)
  58. else
  59. JAVA=$JAVA_HOME/bin/java
  60. fi
  61. fi
  62. if [ -z "$JAVA" ]
  63. then
  64. (
  65. echo "Cannot find a Java JDK."
  66. echo "Please set either set JAVA or JAVA_HOME and put java (>=1.8) in your PATH."
  67. ) 1>&2
  68. exit 1
  69. fi
  70. JVM_ARGS=${JVM_ARGS:--Xmx1200M}
  71. exec $JAVA $JVM_ARGS -jar "$JAR" "$@"
  72. ## Adding custom code to the Fuseki server:
  73. ##
  74. ## It is also possible to launch Fuseki using
  75. ## java $JVM_ARGS -cp "$JAR" org.apache.jena.fuseki.cmd.FusekiCmd "$@"
  76. ##
  77. ## "exec" is optional - it simply frees up an OS process.
  78. ## In this way, you can add custom java to the classpath:
  79. ##
  80. ## APPJAR=MyCode.jar
  81. ## java $JVM_ARGS -cp "$JAR:$APPJAR" org.apache.jena.fuseki.cmd.FusekiCmd "$@"