Pig Latin Anslatortray I've created a program that translates any word into the form of igpay atinlay or pig Latin!

I got the project idea from here and you can read the rules here.

My program outputs the same translation as in the rules section in the link above, except for the word "always". It isn't really a big deal as the program translates almost any word correctly.

package pigLatin;

import java.util.Scanner;

public class PigLatin
{
 String str;
 Scanner scan = new Scanner(System.in);
 char firstVow;
 char secondVow;
 int i;

 public void init()

 {
  str = scan.next();
  i = 0; //beginning of a string

  if (str.length() &lt;= 3 &amp;&amp; (str.charAt(i) == 'a' || str.charAt(i) == 'e' || str.charAt(i) == 'i' || str.charAt(i) == 'o' || str.charAt(i) == 'u'))
  {
   System.out.println(str + "ay");
   scan.close();
  }


  else if (str.length() &gt; 3 &amp;&amp; (str.charAt(i) == 'a' || str.charAt(i) == 'e' || str.charAt(i) == 'i' || str.charAt(i) == 'o' || str.charAt(i) == 'u')) {
   firstVow = str.charAt(i);
   i = 1;

   while (str.charAt(i) != 'a' || str.charAt(i) != 'e' || str.charAt(i) != 'i' || str.charAt(i) != 'o' || str.charAt(i) != 'u')

   {
    i++;
    if (i == str.length() - 1 &amp;&amp; (str.charAt(i) != 'a' || str.charAt(i) != 'e' || str.charAt(i) != 'i' || str.charAt(i) != 'o' || str.charAt(i) != 'u')) {
     System.out.println(str + "ay");
     break;

    } else if (str.charAt(i) == 'a' || str.charAt(i) == 'e' || str.charAt(i) == 'i' || str.charAt(i) == 'o' || str.charAt(i) == 'u')

    {
     secondVow = str.charAt(i);

     //issues arise if the first vowel is equal to the second one
     if (firstVow != secondVow) {

      System.out.print(str.substring(str.indexOf(secondVow), str.length()));
      System.out.print(str.substring(str.indexOf(firstVow), str.indexOf(secondVow)));
      System.out.println("ay");
      break;

     } else if (firstVow == secondVow) {
      System.out.print(str.substring(2));
      System.out.print(firstVow);
      System.out.print(str.charAt(1));
      System.out.print("ay");
      break;
     }
     scan.close();
    }
   }

   //checks for words that begin with consonants
  } else {

   i = 0;
   while (str.charAt(i) != 'a' || str.charAt(i) != 'e' || str.charAt(i) != 'i' || str.charAt(i) != 'o' || str.charAt(i) != 'u')

   {
    i++;
    if (str.charAt(i) == 'a' || str.charAt(i) == 'e' || str.charAt(i) == 'i' || str.charAt(i) == 'o' || str.charAt(i) == 'u')

    {
     firstVow = str.charAt(i);
     System.out.print(str.substring(str.indexOf(firstVow), str.length()) + str.substring(0, str.indexOf(firstVow)) + "ay");
     break;
    }
   }
  }
  scan.close();

 }

 public static void main(String[] args) {
  new PigLatin().init();
 }

}
Your leading whitespace is much smaller than is typical. Prefer 4 spaces for a level of indent.
In java we typically put the curly brace { on the same line. If you insist on doing it on a new line, do it consistently (main) and don't add a blank line of whitespace before the curly brace.
Variable names need to be clear and descriptive. str is meaningless - perhaps word? Likewise, firstVow is confusing, since nobody's getting married. Surely you mean firstVowel. Extra characters come at no charge, so if they make the variable name more descriptive, use them.
Closeable resources need to be closed always. Use either try-with-resources or a finally block to close open resources. Otherwise an exception in the middle of execution will prevent the resource from being closed.
Variables should be defined in the most constraining scope possible. All of your variables can and should be method variables, defined at the time of first need.
You repeat code to see if a character is a vowel. Using either a method so you're only writing the code once or a Set to hold all vowels would be better.
for loops would be easier to read than while loops, since you need all three statement anyway.
Your last block of work (word starts with a consonant) assumes there'll eventually be a vowel in the word.
It's generally preferable that methods return a value rather than performing direct IO themselves. If you don't follow that, the pattern you used for the first two blocks (multiple System.out.print calls) is much easier to read than the one big print with everything mushed together. If you do return a value, using a StringBuilder might be a better idea than using string concatenation.
In several places you store a character and use to that with an indexOf when the index is just i or 0. You should simplify that down.
In a couple of places you do if (condition) { } else if (!condition) { }. It's OK to just do if (condition) { } else { }