Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating a workable jar
    primarykey
    data
    text
    <p>Ok, this is round two of my problem. I have created a simple program in notepad and saved it as a (Blocktestgui.java)java file. I compile with the command javac Blocktestgui.java and get (Blocktestgui.class) I created a text manifest file (see below) and saved it as manifest.mf I then run the command <code>jar cvf bg.jar Blocktestgui.class manifest.mf</code> and get (bg.jar)</p> <p>This is my java file:</p> <pre><code>import javax.swing.JOptionPane; public class Blocktestgui { public static void main(String[] args) { String firstNumber, secondNumber; double number1, number2, sum; firstNumber=JOptionPane.showInputDialog ("Enter wall length in decimal feet:",JOptionPane.INFORMATION_MESSAGE); secondNumber=JOptionPane.showInputDialog ("Enter wall height in decimal feet:",JOptionPane.INFORMATION_MESSAGE); number1=Double.parseDouble (firstNumber); number2=Double.parseDouble (secondNumber); sum = (number1*number2) / 0.88; JOptionPane.showMessageDialog (null, "Total Blocks are " + sum,"Results",JOptionPane.PLAIN_MESSAGE); System.exit (0); } } </code></pre> <p>This is my manifest.mf before creating the jar:</p> <pre><code>Main-Class: Blocktestgui </code></pre> <p>When I extract the contents of the jar I get a folder and two files</p> <p><strong>Folder>--META-INF &lt;--contains MANIFEST.MF&lt;-- This file does not contain the line Main-Class: Blocktestgui</strong></p> <p><strong>File>--Blocktestgui.class</strong></p> <p><strong>File>--manifest.mf&lt;--All this file says is Main-Class: Blocktestgui</strong></p> <pre><code>TestFolder/ |- META-INF/ |- MANIFEST.MF (This file does not contain the line Main-Class: Blocktestgui) |- Blocktestgui.class |- manifest.mf (This file says is Main-Class: Blocktestgui) </code></pre> <p>When I run the jar file in console with java -jar bg.jar it gives me an error of "no main manifest attribute, in bg.jar"</p> <p>What am I messing up on ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload