Something about Jar files

jabber (jabber)
<本文发表于: 相约加拿大:枫下论坛 >
A Jar file is a compressed Java package. If this package contains a class which has a main() method, you can run it as

java -jar xxx.jar

If you want to want run it as a process, enter

start java -jar xxx.jar

or javaw xxx.jar

As a Java programmer, I have not yet got any opportunities to run an application by double clicking. This is why I said Java is not VB.

Indeed, some Jar files are "excutable" because they have one main() method.
In such a case, if you it use javaw.exe,
it will be run as a server process. You have seen it in the Task Manager|Process.

As a Java programmer, use on-line commands.

To "open" a jar file, you can first open Winzip.exe and then drop your jar file into Winzip. Jar file is essentially a kind of zip file.

Another waty to unzip a jar file is enter the commands

jar -xvf xxx.jar

Actually, you can reconfigue your Windows explorer so that jar files are open by Winzip.exe instead of javaw.exe, by default.
I have never tried it.
<本文发表于: 相约加拿大:枫下论坛 >

2000-12-5 -04:00

回到话题: Help. .JAR can't run. When I click the file.jar, the harddisk will run for a while. Then, nothing happend. I click the JAVAW.exe in the \JAVA1.2.2\BIN, it's the same. Nothing will happen except the harddisk running.

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论