Java Program Runs in One Machine and not on Another
<p>I'm studying Java and I just wrote a program that turns CME quotes of soybeans, wheat or corn to "price per 60kg bag" in BRL(Brazilian Currency). I used JSmooth to wrap it and it runs perfectly on my machine. I tried sending it to my wife's PC in a Zip file and I also tried to execute it from the command line directly calling the Main class. In both cases, the program goes until the part where it asks the USD/BRL quote and after one enters it and presses "Enter", the program shows an aparent Runtime error:</p>

<p>Options: soybean / wheat / corn</p>

<p>Type name of commodity(lowercase):</p>

<p>soybean</p>

<p>Type current exchange rate(USD/BRL):</p>

<p>3.11</p>

<pre><code>Exception in thread "main" java.util.InputMismatchException
        at java.util.Scanner.throwFor(Unknown Source)
        at java.util.Scanner.next(Unknown Source)
        at java.util.Scanner.nextDouble(Unknown Source)
        at PriceCME.getExchange_Rate(PriceCME.java:26)
        at PriceCMEExecute.main(PriceCMEExecute.java:8)
</code></pre>

<p>I thought that maybe the version of Java on her pc was outdated, so I removed all previous versions, installed the JDK 111 and tried to run it again.
The same issue happened.
I then tried to recompile the .java files on her PC and there was no compile time error. When I tried to execute it, again the same issue.
The code is the following:</p>

<pre><code>import java.util.Scanner;

public class PriceCME {
    private String nameOfCommodity;
    private final double BUSHEL_SOY_WHEAT = 27.2155;
    private final double BUSHEL_CORN = 25.4012;
    private final int KGPERSACA = 60;
    private double quote;
    private double exchRate;
    private double pricePerSaca;

        public void getNameOfComodity()
    {
        System.out.println("Options: soybean / wheat / corn");
        System.out.print("Type name of commodity(lowercase): ");
        System.out.println();
        Scanner commodity = new Scanner(System.in);
        nameOfCommodity = commodity.next();
    }

    public void getExchange_Rate()
    {
        System.out.print("Type current exchange rate(USD/BRL): ");
        System.out.println();
        Scanner exchangeRate = new Scanner(System.in);
        exchRate = exchangeRate.nextDouble();
    }

    public void getQuote()
    {
        System.out.println("Source for quotes: 
    http://www.cmegroup.com/trading/agricultural/");
        System.out.print("Type quote of commodity on CME: ");
        System.out.println();
        Scanner getQuote = new Scanner(System.in);
        quote = getQuote.nextDouble();
    }

    public void CalculatePricePerSaca()
    {
        switch(nameOfCommodity)
        {
            case "soybean":
            pricePerSaca = (((quote * KGPERSACA) / 100) / 
            BUSHEL_SOY_WHEAT) * exchRate;
            break;

            case "wheat":
            pricePerSaca = (((quote * KGPERSACA) / 100) /
            BUSHEL_SOY_WHEAT) * exchRate;
            break;

            case "corn":
            pricePerSaca = (((quote * KGPERSACA) / 100) /
            BUSHEL_CORN) * exchRate;
            break;
        }
    }

    public void getPricePerSaca()
    {
        System.out.printf("The price of %s \"Por Saca\" is:\nR$ %.2f ",
        nameOfCommodity, pricePerSaca);
        System.out.println();
        System.out.println("Type \"false\" to exit.");
        Scanner end = new Scanner(System.in);
        boolean theEnd = end.hasNext();
    }

    }

  public class PriceCMEExecute {

    public static void main(String[] args)

    {
        PriceCME myPriceCME = new PriceCME();
        myPriceCME.getNameOfComodity();
        myPriceCME.getExchange_Rate();
        myPriceCME.getQuote();
        myPriceCME.CalculatePricePerSaca();
        myPriceCME.getPricePerSaca();

    }
}
</code></pre>

<p>How can this be happening? Would it be a problem on the JVM on her machine?</p>