title: package com.google.gson does not exist
body: <p>I'm working with the following programs: Specifically Tomcat 8, VirtualBox virtual machine, &amp; Gson 2.3.1</p>
  
  <p>I'm trying to test out a method in Gson that allows you marshall/unmarshall Java objects into the JSON format.</p>
  
  <p>This is the code I am using this for (in order for it to compile properly, both classes of java code need to be compiling at the same time...:</p>
  
  <p>Most importantly is my code for testing the JSON conversion method:</p>
  
  <pre><code>package com.cs330;
  import com.google.gson.Gson;
  
      public class IngredientProto 
      {
          public static void main (String[] args)
          {
           Ingredient neo = new Ingredient(6, "cheddar cheese", "cheese");
  
           System.out.println("Object confirmed: " + neo.toString());
  
           //New GSON object for marshalling...
           Gson neoIngredient = new Gson();
  
           //Use said object to create the JSON formatted String for this Ingredient (Object).
           String jsonThis = neoIngredient.toJson(neo);
  
           //Printing out the new object (Ingredient)...
           System.out.println ("Object formatted to JSON: " + jsonThis);
  
           //Convert Back via unmarshalling. NOW!
           Ingredient orga = neoIngredient.fromJson(jsonThis, Ingredient.class);
  
           //Print Again!
           System.out.println("Reverting back into Object variable: " + orga.toString());
         }
        }
  </code></pre>
  
  <p>Here, for reference, is my code for the Ingredient Class I'm working with...</p>
  
  <pre><code>package com.cs330;
  import java.util.Scanner;
  
  public class Ingredient //implements Comparable&lt;Ingredient&gt;
  {
   private int ingredientID;
   private String ingredientName;
   protected String ingredientType;
  
    //DEFAULT CONSTRUCTOR 
    Ingredient()
    {
     this.ingredientID = 0;
     this.ingredientName = "No Ingredient";
     this.ingredientType = "No Type";
    }
  
    //CONSTRUCTOR 1 - Parameters for Name, ID, and Type.
    Ingredient(int ingredientID, String ingredientName, String ingredientType)
    {
     setIngredientID(ingredientID);
     setIngredientName(ingredientName);
     setIngredientType(ingredientType);
    }
  
    //CONSTRUCTOR 2 - Parameters for Name and Type.
    Ingredient(String ingredientName, String ingredientType)
    {
     this.ingredientID = 0;
     setIngredientName(ingredientName);
     setIngredientType(ingredientType);
    }
  
    //Getters and Setters Go here.
  
        //TO STRING
        public String toString()
        {
         String results = " ";
          results = this.ingredientID + ": " + this.ingredientName
                     + " (" + this.ingredientType + ") ";
         return results;
        }//END toSTRING
  
       //...Main for testing...
  
  }//END PROGRAM
  </code></pre>
  
  <p>The errors I keep getting involve the following whenever I try to compile them in CMD on my virtual machine:</p>
  
  <ol>
  <li><code>error: package com.google.gson does not exist</code> - I have import com.google.gson.Gson where it needs to be in my program, yet I keep getting this error my code has nothing wrong with it...</li>
  <li><code>error: class, interface, or enum expected</code> - I actually add package com.google.gson, and I get this error despite everything else being right.</li>
  </ol>
  
  <p>Both errors happen when I try to test the Gson program code out, alongside the Ingredient class I created. My real concern is how I can effectively deal with this...</p>