SOLVED! (Running Beanshell from Windows commandline)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SOLVED! (Running Beanshell from Windows commandline)

Ronald Fischer-3
> -----Original Message-----
> Subject: [Beanshell-users] Running Beanshell from Windows commandline
>
> Although I can execute the bean shell by clicking on the bsh jar file,
> I can't call it from the Windows command line:
>
>   H:\>java bsh.Interpreter
>   Exception in thread "main" java.lang.NoClassDefFoundError:
> bsh/Interpreter
>
> The Bean Shell web page says that I can "install" bsh by
> either putting
> it
> into the Java runtime extension folder, or by putting it in my class
> path.
> I have choosen the former way (right now, I don't use CLASSPATH at all
> yet):
>
> *** Method 1 : ***
>
> H:\>set JAVA_HOME
> JAVA_HOME=C:\Programme\Java\jre1.6.0
> H:\>dir C:\Programme\Java\jre1.6.0\lib\ext\bsh-2.0b4.jar
>  Volume in Laufwerk C: hat keine Bezeichnung.
>  Volumeseriennummer: D893-B517
>
>  Verzeichnis von C:\Programme\Java\jre1.6.0\lib\ext
>
> 15.05.2007  10:43           281.694 bsh-2.0b4.jar
>                1 Datei(en)        281.694 Bytes

I found out why it did not work that way:

When looking for the ext folder, java doesn't seem to honour the
JAVA_HOME
environment variable; whether this is a bug or a feature, I don't know.
In
any case, I happen to have installed two slightly different versions of
the
Java Runtime Environments on my system. I have dropped bsh into the ext
folder of one (and set my JAVA_HOME to this place), but the java.exe was
that of the other environment.

Of course it is not wise to have JAVA_HOME point to a different
installation
directory than where java.exe is to reside, and I will correct it...

Ronald

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Re: SOLVED! (Running Beanshell from Windowscommandline)

David Lee
FYI, CLASSPATH does not do what you think when refering to JAR files
To get a JAR file into the "class path" of the java JVM you have to have
each and every .jar file in the CLASSPATH variable,
not just the directory that contains them.     the directory mode only works
with .class files not with .jar files.
The logic behind this is that a JAR file is essentially a 'directory' of
.class files.   So if you think of the JAR file being a 'directory'
then this may make more sense to you.

On Windows, if you need more then 1 .jar or directory in your CLASSPATH
variable, seperate them by ";"

set
CLASSPATH=path_to_bsh\bsh-2.0b4.jar;path_to_something_else\somethingelse.jar





----- Original Message -----
From: "Ronald Fischer" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, May 15, 2007 6:20 AM
Subject: [Beanshell-users] SOLVED! (Running Beanshell from
Windowscommandline)


>> -----Original Message-----
>> Subject: [Beanshell-users] Running Beanshell from Windows commandline
>>
>> Although I can execute the bean shell by clicking on the bsh jar file,
>> I can't call it from the Windows command line:
>>
>>   H:\>java bsh.Interpreter
>>   Exception in thread "main" java.lang.NoClassDefFoundError:
>> bsh/Interpreter
>>
>> The Bean Shell web page says that I can "install" bsh by
>> either putting
>> it
>> into the Java runtime extension folder, or by putting it in my class
>> path.
>> I have choosen the former way (right now, I don't use CLASSPATH at all
>> yet):
>>
>> *** Method 1 : ***
>>
>> H:\>set JAVA_HOME
>> JAVA_HOME=C:\Programme\Java\jre1.6.0
>> H:\>dir C:\Programme\Java\jre1.6.0\lib\ext\bsh-2.0b4.jar
>>  Volume in Laufwerk C: hat keine Bezeichnung.
>>  Volumeseriennummer: D893-B517
>>
>>  Verzeichnis von C:\Programme\Java\jre1.6.0\lib\ext
>>
>> 15.05.2007  10:43           281.694 bsh-2.0b4.jar
>>                1 Datei(en)        281.694 Bytes
>
> I found out why it did not work that way:
>
> When looking for the ext folder, java doesn't seem to honour the
> JAVA_HOME
> environment variable; whether this is a bug or a feature, I don't know.
> In
> any case, I happen to have installed two slightly different versions of
> the
> Java Runtime Environments on my system. I have dropped bsh into the ext
> folder of one (and set my JAVA_HOME to this place), but the java.exe was
> that of the other environment.
>
> Of course it is not wise to have JAVA_HOME point to a different
> installation
> directory than where java.exe is to reside, and I will correct it...
>
> Ronald
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Beanshell-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/beanshell-users
>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users