Use the. BAT file to run Java in Windows

Source: Internet
Author: User

It is explained based on the running file of a project we just completed. This file should be placed in the classes directory.

PATH % Java-xmx256m-djava. Ext. dirs = .. \ Lib com. Ait. Li. Test. sendmessagepause

Row 1st specifies the current path as the default path

2nd rows-xmx256m, allocating MB of memory to the JVM

-Djava. Ext. dirs = .. \ Lib, Specifies the directory of the jar package used

Com. Ait. Li. Test. sendmessage, Main function class

Rows 3rd do not close the window automatically. You can skip this line during actual operation.

Below is an example of running from an XML file

PATH % Java-xmx256m-djava. Ext. dirs =... \ Lib org. Apache. Camel. Spring. Main-AC test-camel.xmlpause

Org. Apache. Camel. Spring. Main is the class where the main function is located. The Org. Apache. Camel. Spring. Main directory is located in the. \ lib directory.

The configuration file used is test-camel.xml

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.