import java.util.Scanner;

import com.sun.speech.freetts.VoiceManager;
import com.sun.speech.freetts.Voice;

public class TextToSpeech {
public static void main(String args[]){

Scanner input = new Scanner(System.in);
String userInput = input.nextLine();

if(userInput == "hi"){
Voice v;
VoiceManager vm=VoiceManager.getInstance();
v=vm.getVoice("kutlo1");
v.allocate();
v.speak("Hey my name is kutlo");
input.close();
}else
System.out.println("you suck try again");
}

}

im using dr java and bluej

so learn to use BlueJ, or better yet learn Java and ditch that POS excuse for an IDE.
You might want to pick up a better IDE at some point, but learn to use that.
Your "problem" has nothing to do with Java, and everything with you not reading the documentation of your tools.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.