Java project exported as Jar package, project file structure:
Create a new file in the root directory of your project: MANIFEST.MF and a Lib folder (the file folder is in a Third-party package). The contents of the file are as follows:
manifest-version:1.0
Main-class:test. Deltamakeindextest (Here you need to make the corresponding modifications according to the class of the main function, package name. Class name format)
Class-path:././lib/sqljdbc.jar./lib/ikanalyzer3.2.3stable.jar/lib/lucene-analyzers-3.5.0.jar./lib/ Lucene-core-3.6.0.jar (List all the Third-party packages used)
(There is also a blank line here)
For specific MANIFEST.MF How to write can refer to this blog: http://soulshard.iteye.com/blog/346453
Then start the project in the form of a jar bag.
After that, put the Lib folder with the third party jar package and the jar bag I just brought out below the same level.
In Windows, you can write a run.bat file, the content of Java-jar Wip.jar, open cmd CD to switch to the directory where the jar package, running run.
If you are in Linux, you can write a run.sh file and set the permissions to run, the content is Java-jar Wip.jar, the same CD switch to the directory of the jar package, run./run.sh.
If you encounter a Outofmemoryerror:java heap space error, you can set the parameters-xms512m-xmx1024m
-xms <size>
Set JVM initialization heap memory size
-xmx <size>
To set the maximum heap memory size for the JVM
If you encounter Java.lang.OutOfMemoryError:GC overhead limit exceeded error
Parameters can be set-xx:-usegcoverheadlimit