moogeulmoogeul / env.sh
seriouspark's picture
Create env.sh
d17cd01
raw
history blame
837 Bytes
#!/bin/bash
# Java ์„ค์น˜ ๊ฒฝ๋กœ๋ฅผ ํ™•์ธํ•˜๊ณ  JAVA_HOME ์„ค์ •
export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
# JAVA_HOME์ด ์œ ํšจํ•œ์ง€ ํ™•์ธ
if [ -d "$JAVA_HOME" ]; then
echo "JAVA_HOME is set to $JAVA_HOME"
else
echo "Java installation directory not found. Please install Java first."
exit 1
fi
# PATH์— Java ๊ฒฝ๋กœ ์ถ”๊ฐ€
export PATH=$PATH:$JAVA_HOME/bin
# LD_LIBRARY_PATH์— JVM ๊ฒฝ๋กœ ์ถ”๊ฐ€
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/lib/server
# ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์„ค์ •์„ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด ์ถœ๋ ฅ
echo "PATH is set to $PATH"
echo "LD_LIBRARY_PATH is set to $LD_LIBRARY_PATH"
# JPype ์„ค์น˜ (์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋ฉด ์žฌ์„ค์น˜)
pip install --upgrade --force-reinstall JPype1
# ์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰์„ ์™„๋ฃŒํ•˜๊ณ  ์„ฑ๊ณต ๋ฉ”์‹œ์ง€ ์ถœ๋ ฅ
echo "Environment setup complete."