Issue getting program to compile

Here is my code:
import java.util.Scanner;
public class Vowels
     static Scanner console = new Scanner(System.in);
     public static void main(String[] args)
          char ch;
          System.out.print("Enter a letter of the alphabet " +
                              "to see if it is a vowel: ");
               ch = console.next().charAt(0);
          System.out.println();
          System.out.println(isVowel(char ch));
     public static boolean isVowel(char ch)
          switch (ch)
               case 'a': case 'e': case 'i': case 'o': case 'u':
               case 'A': case 'E': case 'I': case 'O': case 'U':
                    return true;
          return false;
}When compiled I get:
C:\temp\Vowels.java:19: '.class' expected
          System.out.println(isVowel(char ch));
^
C:\temp\Vowels.java:19: ')' expected
          System.out.println(isVowel(char ch));
^
2 errors
Tool completed with exit code 1
Message was edited by:
mattvgt

You don't "put it" anywhere. It's not a copy/paste. It's there to show you the pattern.
Read what I wrote. Do you understand the difference between declaring (or defining) a method and calling a method?
Look at where the errors are ocurring.
Look at what you have there.
Look at my code. Notice how I showed declaring a method and calling a method. You're getting the error because you're calling the method, but the stuff you put in the parentheses is like you're declaring it. Get rid of the "char" inside the parens.

Similar Messages

  • Hard drive crashed, saved programs on external hard drive, reinstalling and having issues getting programs to work. What should I do?

    I have a Mac and purchased a student edition of CS6 before you had to subscribe. My hard drive crashed and I was able to reinstall the programs, but there is an error. Does anyone know how to contact support or how to fix the problem?

    cjb1990 wrote:
    Does anyone know how to contact support
    Start from here: Contact Customer Care.

  • XY Graph reference to report generator issue when program is compiled

    I am using Simplicity PDF generator to add a XY Graph to a PDF report, same handle is used in Excel report and works fine. The XY Graph shows up fine when the code it run in development mode, when run as executable, the graph insert routines fail for lack of finding the temp *.bmp fle for the graph 1172. See attachments. Anyone have any idea why the loss of the handle/temp graph error?
    Solved!
    Go to Solution.
    Attachments:
    CreadePdfFrontPageWiring.jpg ‏199 KB
    ErrorReport_SN 108 Run 005e.txt ‏2 KB

    As you said, the error simply says that it can't find the file, which most likely means that the file wasn't created.
    My guess would be this - you're creating the graph in the subVIs with the + and control icons (which is presumably PDF_Generator.Writer.AddImage.vi) and the VI which is shown in the image never has its FP displayed.
    By default, LV removes the FP of all the VIs going into the EXE unless it decides it's going to need the FP. If the FP is removed then the image of the control cannot be accessed and that would presumably prevent the file from being created. The easiest way to confirm this is to create a static property node for one of the controls on the front panel. This will force LV to keep the FP when building the EXE.
    If that doesn't help, then you need to see exactly where the BMP file is supposed to be generated and see if you can log an error from there.
    Try to take over the world!

  • My daughter is a college student. she needs to write and compile c programs on her mac for a class this semester. what is the best place for her to start to get the correct compiler etc. to use ? thanks

    my daughter is a college student. she needs to write and compile c programs on her mac for a class this semester. what is the best place for her to start to get the correct compiler etc. to use ? thanks

    If you know that you will not be asked to design GUI interfaces, and the C programming course will adhere to command line compilation environments, then get the Xcode command-line developer tools, and skip the extra complication of Xcode until you absolutely need it. Apple has kicked GNU C to the curb and is rightly so, using Clang/LLVM compiler technology.
    Sign up for a free Apple Developer account using your Apple ID, and then visit the Mac Dev Center, and towards the bottom of the page, you will see additional downloads. Click on the associated, all down loads link. Know your OS X version beforehand, as the command-line tool releases are tied to general operating system versions, and the most recent Xcode version.  That said, there are currently two March 9, 2015 command-line tools for Xcode 6.2 — one for OS X 10.9 Mavericks, and the other for OS X Yosemite.

  • Getting a program to compile on a mac

    hi i am really new at java, and I would like to know how to get a program to compile. The book I have mentioned something confusing about a javac file in the bin directory, and I found that in my library, But if that is the compiler then I have absolutely no idea how to make my programs compile with that.
    Also if someone could generally explain the compiling process to me that would rock
    Thanks people

    Java is an interpreted language [ like most other languages], it need the Java runtime libraries to execute and the Java compiler to translate your application's code into bits & bytes for the OS to run your application.
    all you need is to install all Java Plug ins, and your application can run in a Mac and also Linux, just as long you do not use extensive Hardware-exclusive APIS [ application programming interfaces].
    but for most of us beginners it doesn't seem to happen a lot. ;-)
    Walter_Rincon

  • Can't get my program to compile

    I'm pretty sure I wrote this close to how it should be, but I can't get it to compile. What am I doing wrong?
    File name: TruckTest.java
    This program tests class Truck which has Vehicle as its super class
    Author: Rajan Alex
    import java.util.*;
    public class TruckTest
    public static void main(String[] args){
    Scanner keyboard = new Scanner(System.in);
    String ownerName = "Peggy", brandName = "Volkswagen";
    int towCapacity = 2000, cylinder = 4;
    double loadCapacity = 2.5;
    Truck t1 = new Truck(); // default constructor
    t1.writeOutput(); //default output
    t1.set(ownerName, brandName, cylinder, loadCapacity, towCapacity);
    t1.writeOutput();
    System.out.println("Enter make name:");
    brandName = keyboard.nextLine();
    System.out.println("Enter owner: ");
    ownerName = keyboard.nextLine();
    System.out.println("Enter number of cylinders:");
    cylinder = keyboard.nextInt();
    System.out.println("Enter load capacity:");
    loadCapacity = keyboard.nextDouble();
    System.out.println("Enter tow capacity:");
    towCapacity = keyboard.nextInt();
    t1 = new Truck(ownerName, brandName, cylinder, loadCapacity, towCapacity);
    t1.writeOutput();
    public class Truck extends Vehicle{
    private double load;
    private int tow;
    public Truck()
    load = 0;
    tow = 0;
    public class Truck(String theOwner, String theBrand, int theBanger, double theLoad, int theTow)
    theOwner = super.theOwner();
    theBrand = super.theBrand();
    theBanger = super.theBanger();
    theLoad = super.theLoad();
    theTow = super.theTow();
    public void writeOutput()
    super.writeOuput();
    public void set(String aOwner, String aBrand, int aCylinder, double aLoad, int aTow)
    aOwner = super.aOwner();
    aBrand = super.aBrand();
    aCylinder = super.aCylinder();
    aLoad = super.aLoad();
    aTow = super.aTow();
    public class Vehicle{
    private String manufacturer;
    private int cylinder;
    private String owner;
    public Vehicle(){
    manufacturer = none;
    cylinder = 0;
    owner = 0;
    public class Vehicle(String theOwner, String theBrand, int theBanger)
    owner = theOwner;
    manufacturer = theBrand;
    cylinder = theBanger;
    public void writeOutput()
    super.writeOutput();
    System.out.println("Owner: = " + owner);
    System.out.println("Manufacturer: = " + manufacturer);
    System.out.println("Number of cylinders: = " + cylinder);
    public void set(String aOwner, String aBrand, int aCylinder, double aLoad, int aTow)
    aOwner = super.ownerName();
    aBrand = super.brandName();
    aCylinder = super.cylinder();
    aLoad = super.loadCapacity();
    aTow = super.towCapacity();
    }

        // *not* public class Vehicle
    public Vehicle(String theOwner, String theBrand, int theBanger)I think you mean this to be a constructor, not a class declaration.
    It's a good idea to wrap your code in code tags when you post. As
    Described here: http://forum.java.sun.com/help.jspa?sec=formatting
    Put [code] at the start of your code and [/code] at the end.
    [Edit] You have the same problem with the Truck class.

  • Getting one java program to compile another

    Was wondering if anyone knew if it is possible ot get one java program to compile another .java file and capture any errors.

    public static void RunCommand( String theCommand ) throws Exception
    Runtime runtime = Runtime.getRuntime();
    System.out.println( "Running Command " + theCommand ) ;
    Process process = runtime.exec(theCommand);
    String s = null ;
    BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(process.getErrorStream()));
    // read the output from the command
    System.out.println("Here is the standard output of the command:\n");
    while ((s = stdInput.readLine()) != null) {
         System.out.println(s);
    // read any errors from the attempted command
    System.out.println("Here is the standard error of the command (if any):\n");
    while ((s = stdError.readLine()) != null) {
         System.out.println(s);

  • Cannot get Java to compile

    I have recently installed the newest Java version on my XP computer. I can't get it to compile the programs
    I have written. I have it saved in C:/Program Files/java_save. When I go to compile I get "javac is not a recognized action or file name." I have tried creating the path in the system settings but I still cannot get it to work. I have tried just about everything I can think of. I am getting really frustrated and haven't gotten an answer from java when I emailed them. Do I need to reinstall java or am I doing something wrong? Any help would be appreciated. Thank You!
    trtrainer

    'Software\JavaSoft\Jave Runtime
    Environment\CurrentVersion' has value '1.4' but '13'
    is required.
    Error: could not find java.dll
    Error: could not find Java 2 Runtime EnvironmentA fast review of the threads on this topic lead me to believe you may need to either 1) add the new bin directory to the path variable as mentioned earlier 2) reinstall the JRE only, due to confusion at the registry level 3) edit/repair the registry itself (careful...)
    Note also the order of the items in the PATH setting. As discussed here in Reply 1..
    http://forum.java.sun.com/thread.jsp?forum=54&thread=164483
    You may wish to remove from the PATH setting any earlier versions of a java sdk you had attempted to install.
    Here are some other threads on this topic..
    http://forum.java.sun.com/thread.jsp?forum=32&thread=142506
    http://forum.java.sun.com/thread.jsp?forum=31&thread=276400
    Reply 1 of this thread suggests reinstalling Java and the response from the OP is that the reinstall resolved the issue.
    http://forum.java.sun.com/thread.jsp?forum=54&thread=299702
    If you installed an IDE with it's own JDK, you may want to look at Reply 2 here..
    http://forum.java.sun.com/thread.jsp?forum=54&thread=183721
    When I type the path: c:\j2sdk1.4.2_04\bin\javac
    HelloWorldApp.java, I get: Error: Cannot Read:
    HelloWorldApp.javaThis simply means that the compiler can not find the file "HelloWorldApp.java" inside the directory from where you are attempting to compile the file.

  • Cannot embed pdfs in MS Word doc which are PDF Version 1.3 (Acrobat 4.x) [This is associated with Adobe Reader 9]. Getting 'program not installed' error.

    Cannot embed pdfs in Word doc which are PDF Version 1.3 (Acrobat 4.x) [This is associated with Adobe Reader 9]. Getting 'program not installed' error.
    Pdfs with other versions are okay:
    Tested successfully with Adobe Pro 9 (Version 1.5 (Acrobat 6.x)), Reader X (Version 1.4 (Acrobat 5.x)) and XI (Version 1.6 (Acrobat 7.x))
    Also cannot open embedded pdfs which have been embedded with this version (getting a similar error).
    Importantly I have removed/disabled all security options in Adobe Reader, following numerous internet suggestions from Adobe and elsewhere. This does not fix the problem.
    Currently the work around is to re-save the pdf with something other than Adobe Reader 9 (so the version updates), but we would prefer not to do this for all the old pdfs we have.
    Thank you,
    Louise.

    Could you please email me the document on which you are seeing this issue at [email protected] ?
    Please mention the forum thread link as well in the mail for the reference.
    Thanks,
    Atul

  • Cant get it to compile

    I am trying to creat a simple program with the JOptionPane. I cant get it to compile, so if any can help me I would apperciate it. Thanks!
    import javax.swing.*;
    public class myPane {
      public static void main(String[] args) {
            getPass(args);
      private static void getPass(String[] args) {
            String s,v,d;
            s = (String)JOptionPane.showInputDialog(null, "Username", "Java command line", JOptionPane.PLAIN_MESSAGE, null, null, "");
            if((s != null) && (s.length() > 0)) {
                    v = (String)JOptionPane.showInputDialog(null, "Password", "Java command line", JOptionPane.PLAIN_MESSAGE, null, null, "");
                    if((v != null) && (v.length() > 0)) {
                            JOptionPane.showMessageDialog(null, "Thank You!", "Java command line");
      d = (String)JOptionPane.showInputDialog(null, "Which command line would you like to run", "Java command line", JOptionPane.PLAIN_MESSAGE, null, null, "");
                    if((d != null) && (d.length() > 0)) {
                             JOptionPane.showMessageDialog(null, "Executing", "Java command line"); System.exit(0);
                    else {
                            JOptionPane.showMessageDialog(null, "You must enter a command");
                            getPass(args);
                    else {
                            JOptionPane.showMessageDialog(null, "Please enter a password");
                            getPass(args);
            else {
                    JOptionPane.showMessageDialog(null, "Please enter a username");
                    getPass(args);
             

    You have two invalid statements:
    JOptionPane.showMessageDialog(null, "Thank You!", "Java command line");
    JOptionPane.showMessageDialog(null, "Executing", "Java command line");The arguments are not acceptable - see the API documentation.

  • Help T_T - Program not compiling properly

    I'm trying to add a short animation to the source file for a
    game that was built by an outside studio. Unfortunately, I can't
    seem to get the program to compile correctly: I get tons of errors,
    graphics dont diplay properly, etc. I thought perhaps I had just
    messed something up with my codes and animations, but even if i try
    to compile the original unedited file as a control test, i get the
    same problems. I have all the external files, scripts, etc.
    None of our scripters are in-house, so there's no one I can
    ask about this. I know just enough actionscript to prevent Flash
    from exploding into a gooey mass (which is how I ended up getting
    tasked with this), but basically my knowledge of flash is limited
    to it as an animation program so I'm not really sure if theres some
    kind of settings I need to change, specifically need to export as
    an .exe (shouldn't be, since the game runs as a .swf), or what.
    I know i'm not providing a whole lot of information about the
    problem, but thats because I'm not really sure what info is
    relevant. Let me know if there's anything people need from me and
    I'll get it to you.
    Thanks!

    Just a had brief look, but shouldn't it be:public class TempConversion extends JFrameIf you post code it is a good idea to use the formatting tags:
    http://forum.java.sun.com/help.jspa?sec=formatting
    Basically the idea is you put [code] at the start of your code and [/code]
    at the end.

  • Issues with program

    I have already paid for the full year but it won't let me change a PDF to Word because I haven't paid

    Hi Denise Van Meter,
    Thanks for subscribing to Adobe Acrobat Plus (one-year). Here's a snapshot of your order and steps for getting started.
      Subscription order details:
    Re: Issues with program
    Adobe Acrobat Plus (one-year) (Mac/Win,Multiple Languages)
    <removed by admin>
    For complete details, just click your order number <removed by admin>
      Here's how to get started:
    Sign in to your Adobe Acrobat Plus (one-year) <removed by admin> account with your Adobe ID and password.
    If you need support, visit the Help pages<http://www.adobe.com/go/apaphelp>.
    Dear Denise,
    http://www.adobe.com/content/dam/Adobe/email/spacer.gif
    Welcome to Adobe. Your Adobe ID is <removed by admin>
    Your Adobe ID is your access key to any of Adobe's online services, such as:
      Adobe.com<http://www.adobe.com/>. Download free trials, buy products, manage orders and participate in user forms.
      Adobe® Creative Cloud™<https://creative.adobe.com/>. Get all the Creative Suite applications plus online services for a low monthly price.
      Adobe® Document Services<https://www.acrobat.com/welcome/en/home.html>. Create and edit PDF files, distribute and analyze forms, and sign documents electronically.
    Thank you and enjoy,
    The Adobe Team

  • Keep getting "program couldn\'t download" when trying to download driver for officejet 6000

    keep getting "program couldn\'t download" when trying to download driver for officejet 6000

    Hello,
    I see that you're having an issue installing the software. Have you tried installing the software from a different browser? 
    Does this happen on chrome and IE?

  • Program not compiling giving Error : Invalid path, "C:\Program Files\Java--

    I am using jcreator where i am getting this error while compiling
    Error : Invalid path, "C:\Program Files\Java\j2re1.4.2_05\bin\javac.exe" -classpath "C:\Program Files\Xinox Software\JCreatorV3LE\MyProjects\zeroCode\classes" -d C:\Program" Files\Xinox "Software\JCreatorV3LE\MyProjects\zeroCode\classes C:\Program" Files\Xinox Software\JCreatorV3LE\MyProjects\zeroCode\src\BasicServiceLister.java
    Instead of that same program is compiling in textpad/eclipse easily.
    Please tell me what should i do to set what.
    present settings are:
    User Variable:
    classpath C:\Program Files\Xinox JCreatorV3LE\MyProjects\zeroCode\ classes
    Java_HOme: C:\Program Files\Java\j2re1.4.2_05\bin\javac.exe
    Path:C:\Program Files\Java\j2re1.4.2_05\bin
    Classpath is System Variables:
    C:\Program Files\Xinox Software\JCreatorV3LE\MyProjects\zeroCode\ classes
    Path :C:\Program Files\Java\j2re1.4.2_05\bin
    wher i really need to modify the settings:
    May be thorugh command prompt.
    I never did. windowds environment varaibles i can set.
    Thanks
    Vijendra

    ... -d C:\Program" Files\Xinox "Software\JCreatorV3LE\MyProjects\zeroCode\classes ...
    Looks like you are typing in things wrong with the double quotes.

  • Getting "program used to creat ethis object is AcroExch"

    Getting "program used to creat ethis object is AcroExch. That program is not installed on your computer." when trying to open PDFs embedded in Word.  Some work and some give me the error message above.
    I am on Acrobat Standard 10.1.7 and Word 2007, on Windows 7.
    Anyone have any fixes that might resolve this issue? 

    There is a comment in http://community.spiceworks.com/topic/119912-adobe-10-update-acroexch-error-now-occurring that provides the following information:
    Disabling Protected Mode in Adobe Reader X
    1. Open Adobe Reader X.
    2.From Edit menu select Preferences, Preferences dialog box appears.
    3.Select General category on the list, uncheck or remove tick mark for “Enable protected mode at startup”
    Adobe Reader’s Protected Mode will be turned off.
    Though it is for Reader, I assume it should do the job for Acrobat also.

Maybe you are looking for

  • How to get registry key lastwritetime using batch/powershell

    Hello, I want to get a registry key's LastWriteTime using batch/powershell.  These are what i have tried.. 1. Launch regedit and manually export the key using the UI, this gives me the lastwritetime, but I need a commandline version of this.  regedit

  • PDFMaker Office 2010 fails while creating the PDF

    I have a Window 7 laptopn with Office 2010 Adobe Acrobat 8.2.5. Slect create PDF button on tool bar and process starts but hangs while "onverting to PDF". Error occurs in MS Word, Excel & Powerpoint. System has worked fine up unitl a week ago. PDF cr

  • Wireless Network Management with Multiple SSIDs in one Wireless Profile

    Could anybody explain me about how Multiple SSIDs in one Wireless Network Name (Network Profile) ? Configuration will be pushed to Windows 7 Pro from Wins Server 2008 R2. Objective: Multiple office locations will have different SSIDs and when the lap

  • Change of system time in SAP

    Hi We wanted to change the system time in SAP and we have already posted certain documents. Pls let me know, if we change the time. Will there be any impact on the posted documents Regards Madhan D

  • Concurrent we service call issue

    I am using spring2.5 framework and tomcat6 as web server. I do have a web service implmentation on this. When my consumer applications are trying to call this WS concuurently, The WS response got mis matched or one call gets others response. How do I