Running Beanshell from Windows commandline

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

Running Beanshell from Windows commandline

Ronald Fischer-3
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
               0 Verzeichnis(se), 42.327.769.088 Bytes frei


But even if I create a CLASSPATH environment variable containing the
directory
which contains the bsh jar file of bsh, it doesn't work:

*** Method 2 : ***

H:\>set CLASSPATH=C:\Programme\Java\jre1.6.0\lib\ext
H:\>java bsh.Interpreter
Exception in thread "main" java.lang.NoClassDefFoundError:
bsh/Interpreter


The only thing which I found so far would work for me, is to put the
name of
the jar file into CLASSPATH:

*** Method 3 : ***

H:\>set CLASSPATH=C:\Programme\Java\jre1.6.0\lib\ext\bsh-2.0b4.jar
H:\>java bsh.Interpreter
BeanShell 2.0b4 - by Pat Niemeyer ([hidden email])
bsh %


So I wonder why java is unable to locate bsh by the first two
methods....

Ronald


--
Ronald Fischer <[hidden email]>
Phone: +49-89-452133-162
 

-------------------------------------------------------------------------
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: Running Beanshell from Windows commandline

Alexey Zinger
You may want to delete java.exe and/or javaw.exe from <WINDOWS_HOME>/system32
directory and update your PATH to include <JAVA_HOME>/bin.  This should force
JRE to use <JAVA_HOME>/lib/ext to find the BeanShell jar.  Sigh, yes, it's 2007
and we're still screwing around with classpaths.

--- Ronald Fischer <[hidden email]> wrote:

> 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
>                0 Verzeichnis(se), 42.327.769.088 Bytes frei
>
>
> But even if I create a CLASSPATH environment variable containing the
> directory
> which contains the bsh jar file of bsh, it doesn't work:
>
> *** Method 2 : ***
>
> H:\>set CLASSPATH=C:\Programme\Java\jre1.6.0\lib\ext
> H:\>java bsh.Interpreter
> Exception in thread "main" java.lang.NoClassDefFoundError:
> bsh/Interpreter
>
>
> The only thing which I found so far would work for me, is to put the
> name of
> the jar file into CLASSPATH:
>
> *** Method 3 : ***
>
> H:\>set CLASSPATH=C:\Programme\Java\jre1.6.0\lib\ext\bsh-2.0b4.jar
> H:\>java bsh.Interpreter
> BeanShell 2.0b4 - by Pat Niemeyer ([hidden email])
> bsh %
>
>
> So I wonder why java is unable to locate bsh by the first two
> methods....
>
> Ronald
>
>
> --
> Ronald Fischer <[hidden email]>
> Phone: +49-89-452133-162
>  
>
> -------------------------------------------------------------------------
> 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
>


Alexey
2001 Honda CBR600F4i (CCS)
1992 Kawasaki EX500
http://azinger.blogspot.com
http://bsheet.sourceforge.net
http://wcollage.sourceforge.net



 
____________________________________________________________________________________
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front

-------------------------------------------------------------------------
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