Method for simply running Java programs under the Windows platform

xiaoxiao2021-03-05  27

What do you need to run a Java program? Of course, it is JVM. You can find J2RE download from Sun's homepage. JSDK will take this running environment. Because JVM is used to explain the bytecode compiled after our program, we want to run the Java program must have its support. Ok, usually our Java programs are compiled and then the Java command to perform our bytecode programs. Is there a way to run like the programs below Windows? The answer is to use batch to solve this problem. First we create a new notebook file, the file name can be myjar, enter the following content javac% 1.java echo main-class:% 1> conf.txt jar cmf conf.txt% 1.jar * .class then The suffix name of this file is changed to .bat, then put this file in your C: / Windows directory. Generate .jar files in the Java source program you want to run directly through Myjar ClassName. You can run your program directly by double-hit .jar program. But the premise is that there must be JVM in your system.

转载请注明原文地址:https://www.9cbs.com/read-34471.html

New Post(0)