Skip to content

Apache Lucene open-source search software

Revert "LUCENE-9448: clean up unused start scripts for luke."

Tomoko Uchida2160d7239df3
diff --git a/lucene/luke/README.md b/lucene/luke/README.md
index 32beae653f5..335b232db7d 100644
--- a/lucene/luke/README.md
+++ b/lucene/luke/README.md
@@ -30,12 +30,9 @@ Luke (atop Swing) is the GUI tool for introspecting your Lucene index. It allows
## Launching Luke
-Luke requires Java 11 or above.
-
Using a binary release
-The [Lucene Downloads](https://lucene.apache.org/core/downloads.html) page contains stable releases of Lucene including Luke. You can start it with:
-java -jar lucene-luke-x.x.x-standalone.jar
+The [Lucene Downloads](https://lucene.apache.org/core/downloads.html) page contains stable releases of Lucene including Luke. Download the respective release, unpack and run a shell or batch scripts inside the folder 'luke' (or directly with java -jar if you prefer it that way).
## Older releases
diff --git a/lucene/luke/bin/luke.bat b/lucene/luke/bin/luke.bat
new file mode 100644
index 00000000000..4d83d8bf319
--- /dev/null
+++ b/lucene/luke/bin/luke.bat
@@ -0,0 +1,13 @@
+@echo off
+@setlocal enabledelayedexpansion
+
+cd /d %~dp0
+
+set JAVA_OPTIONS=%JAVA_OPTIONS% -Xmx1024m -Xms512m -XX:MaxMetaspaceSize=256m
+
+set CLASSPATHS=.\*;.\lib\*;..\core\*;..\codecs\*;..\backward-codecs\*;..\queries\*;..\queryparser\*;..\suggest\*;..\misc\*
+for /d %%A in (..\analysis\*) do (
+ set "CLASSPATHS=!CLASSPATHS!;%%A\*;%%A\lib\*"
+)
+
+start javaw -cp %CLASSPATHS% %JAVA_OPTIONS% org.apache.lucene.luke.app.desktop.LukeMain
diff --git a/lucene/luke/bin/luke.sh b/lucene/luke/bin/luke.sh
new file mode 100755
index 00000000000..7c7d9191056
--- /dev/null
+++ b/lucene/luke/bin/luke.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+LUKE_HOME=$(cd $(dirname $0) && pwd)
+cd ${LUKE_HOME}
+
+JAVA_OPTIONS="${JAVA_OPTIONS} -Xmx1024m -Xms512m -XX:MaxMetaspaceSize=256m"
+
+CLASSPATHS="./*:./lib/*:../core/*:../codecs/*:../backward-codecs/*:../queries/*:../queryparser/*:../suggest/*:../misc/*"
+for dir in `ls ../analysis`; do
+ CLASSPATHS="${CLASSPATHS}:../analysis/${dir}/*:../analysis/${dir}/lib/*"
+done
+
+LOG_DIR=${HOME}/.luke.d/
+ if [[ ! -d ${LOG_DIR} ]]; then
+ mkdir ${LOG_DIR}
+ fi
+
+nohup java -cp ${CLASSPATHS} ${JAVA_OPTIONS} org.apache.lucene.luke.app.desktop.LukeMain > ${LOG_DIR}/luke_out.log 2>&1 &