You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An extremely simple Java GUI program displaying ocean waves.
Executing the Program
One can download the executable Java archive (JAR) file with the filename 'waves.jar' and execute the program like so: java -jar waves.jar
Compiling the Program
Compiling this Java program is as simple as it gets. There is nothing to put on the classpath. Simply navigate to where the 'Waves.java' file is and use the *javac* program like so to compile the program: javac Waves.java. This will create two class files:
Waves$1.class
Waves.class
I forget why there are two classes. I think this means there is an inner class in the enclosing class. Although, I do not see an obvious inner class definition in my program. If you are reading this for some strange reason feel free to leave a comment or send a message explaining why there are two classes.
Creating the Executable Jar
Make sure the 1) class files, 2) waves2.jpg, and 3) MANIFEST.MF file are in the same directory. Ideally you would create a new folder on your operating system (OS) and places only these files in there. This will prevent errors and prevent confusion. Please do not re-name the jpeg as the source code specifically calls this filename. If the filename is changed the program will not work. Massive farts broken hearts. It may need to be stated that the program waves.java needs to be compiled as explained at the beginning of this readme. Now that we have our byte code, jpeg, and manifest file we can issue the following command to create the executable jar file: jar -cfm waves.jar MANIFEST.MF Waves*.class waves2.jpeg I am using a regular expression with the Waves class files. This command will put anything that starts with Waves and ends with class into the jar. Make sure you only have the two Waves class files shown in the list above in your directory or you will have something you may not want.
About
An extremely simple Java GUI program displaying ocean waves.