[Talk-it] Help per Osmosis

albertobonati albertobonati at libero.it
Wed May 26 08:08:07 BST 2010


Il 26/05/2010 8.50, Federico Cozzi ha scritto:
> Usare quel file .bat invece di quello che hai fatto tu?
>
> Java, all'avvio, richiede un parametro che è il classpath e che è del
> tutto analogo al parametro path (di unix o windows). Come path indica
> dove trovare l'eseguibile, il parametro classpath indica dove trovare
> le librerie ("classi") che servono al programma.
> Un programma Java, nella stragrande maggioranza dei casi, esegue dei
> link dinamici durante l'esecuzione del programma stesso, cioè va a
> cercare delle classi aggiuntive (sottoforma di file .class o più
> spesso .jar) che servono all'esecuzione del programma. Se non le
> trova, ecco l'errore ClassNotFoundException, che appunto avviene a
> runtime e blocca l'esecuzione del programma.
> A quel punto per risolvere il problema bisogna aggiungere il parametro
> classpath all'esecuzione di java, o più spesso aggiungere ulteriori
> directory a quelle già indicate nel classpath.
>
> Se c'è un file .bat incluso nella distribuzione di Osmosis, è
> sperabile che imposti il classpath corretto (se non lo fa, è un bel
> bug). Se invece il .bat di avvio lo fai tu, è matematico che ti scordi
> qualche directory e poi ottieni ClassNotFound...
>
> Prova a guardare il file .bat di Osmosis e confrontarlo col tuo.
>
> Ciao,
> Federico
>
> _______________________________________________
>    

Il file osmosis.bat è questo:

@ECHO OFF

REM This is an equivalent Windows batch file to complement the unix 
shell script
REM Corresponding lines from the shell script are printed before the 
matching batch file commands

REM # Config files can define several variables used throughout this script.
REM # JAVACMD - The java command to launch osmosis.
REM # JAVACMD_OPTIONS - The options to append to the java command, 
typically used to modify jvm settings such as max memory.
REM # OSMOSIS_OPTIONS - The options to apply to all osmosis invocations, 
typically used to add plugins or make quiet operation the default.

REM if [ -f /etc/osmosis ] ; then
REM   . /etc/osmosis
REM fi
IF EXIST %ALLUSERSPROFILE%\osmosis.bat CALL %ALLUSERSPROFILE%\osmosis.bat

REM if [ -f "$HOME/.osmosis" ] ; then
REM   . "$HOME/.osmosis"
REM fi
IF EXIST %USERPROFILE%\osmosis.bat CALL %USERPROFILE%\osmosis.bat


REM if [ -z "$JAVACMD" ] ; then
REM   # No JAVACMD provided in osmosis config files, therefore default 
to java
REM   JAVACMD=java
REM fi
IF "%JAVACMD%"=="" set JAVACMD=java

REM Set "SAVEDIR" to the current directory
set SAVEDIR=%CD%
set MYAPP_HOME=%~dp0..
REM Now make the MYAPP_HOME path absolute
cd %MYAPP_HOME%
set MYAPP_HOME=%CD%
REM Change back to the original directory
cd %SAVEDIR%

set MAINCLASS=org.codehaus.classworlds.Launcher
set PLEXUS_CP=%MYAPP_HOME%\lib\default\plexus-classworlds-2.2.2.jar
SET EXEC=%JAVACMD% %JAVACMD_OPTIONS% -cp "%PLEXUS_CP%" 
-Dapp.home="%MYAPP_HOME%" 
-Dclassworlds.conf="%MYAPP_HOME%\config\plexus.conf" %MAINCLASS%  
%OSMOSIS_OPTIONS% %*

%EXEC%

Ma come faccio a dirgli di unire i files???






More information about the Talk-it mailing list