Hallo zusammen,
ich einen Java-Ausführungsbefehl(dieser befindet sich in einem sh-Skript) unter UNIX, der mich gerade zum Wahnsinn treibt:
Ich verstand nicht, wie ${JAVA_OPTS} hier gehandhabt wird. Daraufhin habe ich viel gegoogelt und habe auch viel gefunden:
Also anscheinend kann JAVA_OPTS als eine Art lokale Umgebungsvariable zur Java-Ausführung angewendet werden(auf Deutsch: gilt nur für die betroffene Session). Nun zurück zu dem Befehl:
1. In diesem Befehl stehen stand-alone-Settings -Xms768m -Xmx1g vor ${JAVA_OPTS}. Hinter ${JAVA_OPTS} sind doch sicherlich die Standard-Settings von diesen ganzen -Xms -Xmx... vorhanden. Wenn shell für Java also ${JAVA_OPTS} auflöst, dann sähe der ganz Befehl doch so aus:
Ist das nicht doppelt gemoppelt? Vor allen Dingen, welche Werte werden denn genommen für den JVM?
2. Was bedeutet die Option -cp? Hierzu konnte ich im Netz leider nichts finden.
3. Der String ubmatrix.xbrl.tools.xbrlCalculate.src.XbrlCalculate $@, was hat er zu bedeuten?
Ich bedanke mich für Eure Hilfe.
Viele Grüße aus Rheinland,
Eure Ratna
ich einen Java-Ausführungsbefehl(dieser befindet sich in einem sh-Skript) unter UNIX, der mich gerade zum Wahnsinn treibt:
Code:
java -Xms768m -Xmx1g ${JAVA_OPTS} -cp "${CLASSPATH}" ubmatrix.xbrl.tools.xbrlCalculate.src.XbrlCalculate $@
Ich verstand nicht, wie ${JAVA_OPTS} hier gehandhabt wird. Daraufhin habe ich viel gegoogelt und habe auch viel gefunden:
when you do it from the command line, the params are not written anywhere. They exist only for your current bash session.
Put export JAVA_OPTS="..." in your ~/.bashrc or ~/.bash_profile files to persist them. If you are on OS X you will have to source the .bashrc file from .profile.
The statement just assigns the environment variable JAVA_OPTS the given value. There is no file involved here.
Later JAVA_OPTS maybe passed to the command line of java executable
I don't know of any JVM that actually checks the JAVA_OPTS environment variable. Usually this is used in scripts which launch the JVM and they usually just add it to the java command-line.
The key thing to understand here is that arguments to java that come before the -jar analyse.jar bit will only affect the JVM and won't be passed along to your program. So, modifying the java line in your script to:
java $JAVA_OPTS -jar analyse.jar $*
should just work
Also anscheinend kann JAVA_OPTS als eine Art lokale Umgebungsvariable zur Java-Ausführung angewendet werden(auf Deutsch: gilt nur für die betroffene Session). Nun zurück zu dem Befehl:
Code:
java -Xms768m -Xmx1g ${JAVA_OPTS} -cp "${CLASSPATH}" ubmatrix.xbrl.tools.xbrlCalculate.src.XbrlCalculate $@
1. In diesem Befehl stehen stand-alone-Settings -Xms768m -Xmx1g vor ${JAVA_OPTS}. Hinter ${JAVA_OPTS} sind doch sicherlich die Standard-Settings von diesen ganzen -Xms -Xmx... vorhanden. Wenn shell für Java also ${JAVA_OPTS} auflöst, dann sähe der ganz Befehl doch so aus:
Code:
java -Xms768m -Xmx1g -Xms256m -Xmx512m (...) -cp "${CLASSPATH}" ubmatrix.xbrl.tools.xbrlCalculate.src.XbrlCalculate $@
2. Was bedeutet die Option -cp? Hierzu konnte ich im Netz leider nichts finden.
3. Der String ubmatrix.xbrl.tools.xbrlCalculate.src.XbrlCalculate $@, was hat er zu bedeuten?
Ich bedanke mich für Eure Hilfe.
Viele Grüße aus Rheinland,
Eure Ratna
