I'm doing Hello world in Eclipse. It's late, but it's a memorandum level.
Ubuntu 16.04 Eclipse 3.8 CPU C2D memory 4G
1 New-Project Create "Hello World". 2 src to new-package Create "example.com". 3 new-class on example.com Create "Hello World". 4 Edit HelloWorld.class.
package example.com; public class HelloWorld { public static void main(String args[]){ System.out.println("HelloWorld"); } }
Run as Java application If all goes well, Hello World will be displayed on the console.
cd workspace/Helloworld/bin java example.com.Helloworld
If all goes well, Hello World is displayed.
Today's main event.
Select a project in Package Explorer and File-Export Select JAVA-JAR File. The rest is created according to the procedure. Almost Next. Select Main Class on the third screen. Hello World.
The JAR file is created in the workspace, so cd cd workspace Helloworld.jar Will be executed in. If not in run mode java -jar HelloWorld.jar But you can do it.
Recommended Posts