Java Script first recognized beanshell

Source: Internet
Author: User
There are many script languages. Although Perl is not very useful after reading it a few times ago, it is really good at processing documents, especially in the application of regular expressions, if you want to practice regular expressions, using Perl as a platform to practice is indeed a good choice, but for Java support, of course, I prefer groovy, which is not only quick and easy to understand, it is also very easy for Java learners.
I just bought a new book "Java Script Programming" in the past two days and saw many scripting languages, however, what interest me is not the groovy or other Jython or rhino scripting languages that I strongly advocate, but beanshell, which is the first scripting language to introduce Java syntax, you can regard it as a very small, embedded Java source code interpreter. In addition, it also extends the Java syntax, such as foreach and autoboxing only available in java1.5, and so on. These may be attributed to the subsequent modifications to these Java versions. (* ^_^ *)
In fact, what attracts me most is that the size of his execution file is only a single jar package of KB. Compared with other script languages, the size is much larger than kb, it may be fatal for the application of j2-based.
You can download the latest beanshell version from www.beanshell.org. Because most jar packages are executed using the Java-jar command, the most open and convenient method is this, however, beanshell also provides another way to call the console, but you must load the beanshell JAR file to the classpath class for running. I use ubuntu8.04, So I directly add it to the profile file.
Export classpath = $ classpath:/path-to_jar_location/bsh-xxx.jar (XXX is the release version)
Then, enter Java bsh. Console in terminal to start the console. You can also use Java bsh. interpreter helllo. bsh to execute the compiled script.
Like groovy, beanshell also maps the methods used to access the JavaBean attribute. You do not need to use the get and set methods to directly use file. name can be called directly. The idea of the script language is fully realized here. The fewer code is used to implement more functions, and the script is a language suitable for humans, instead of adapting to the machine language.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.