https://github.com/macagua/example.java.helloworld
"Hello World" Example for Java
https://github.com/macagua/example.java.helloworld
hello-world helloworld java
Last synced: 6 months ago
JSON representation
"Hello World" Example for Java
- Host: GitHub
- URL: https://github.com/macagua/example.java.helloworld
- Owner: macagua
- License: gpl-2.0
- Created: 2015-06-17T13:23:36.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-06-30T07:57:00.000Z (over 1 year ago)
- Last Synced: 2025-03-30T21:11:59.129Z (7 months ago)
- Topics: hello-world, helloworld, java
- Language: Java
- Size: 9.77 KB
- Stars: 32
- Watchers: 5
- Forks: 279
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
example.java.helloworld
=======================This is "Hello World" Example for Java.
The structure ``HelloWorld`` package is like this: ::
example.java.helloworld/
|-- HelloWorld
| `-- Main.java
|-- LICENSE
|-- Manifest.txt
`-- README.mdCompile class
-------------For compile the main class for package, execute the follow command: ::
javac HelloWorld/Main.java
This generate the ``Main.class`` file into ``HelloWorld`` directory.
Run class
---------For run the main class for package, execute the follow command: ::
java -cp . HelloWorld.Main
This show the ``Hello world`` message.
Create a JAR file
-----------------For pack the main class for package as a JAR file, execute the follow command: ::
jar cfme Main.jar Manifest.txt HelloWorld.Main HelloWorld/Main.class
Run a JAR file
--------------For run the JAR file packed, execute the follow command: ::
java -jar Main.jar
This show the ``Hello world`` message.
Reference
=========- `java - How to run a JAR file - Stack Overflow `_.
- `Setting an Application's Entry Point (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files) `_.