Javac doesn't recognize java.io as valid class...

This is my program...
class MyProgram {
     public static void main(String[] args) throws java.io.IOException {
          java.io.FileInputStream("TestDocu.txt");
}This gives this error
c:\Java>javac MyProgram.java
MyProgram.java:7: cannot find symbol
symbol : class io
location: package java
java.io.FileInputStream("TestDocu.txt");
____^____________________________What to do?
By the way my CLASSPATH setting is null(i.e not exist), and using Vista.

corlettk wrote:
Welcome to the club. I make that mistake daily! Sometimes two or three times a day. The trick is recognising the error message. It is a bit cryptic.
Also might I suggest that you google any compiler error messages... I'm guessing that every java compiler diagnostic message has been posted on a forum at some stage... and as a noob you can be even more confident because the kind of messages noobs typically trip-over are "common problems".
It takes a twu-masta, with years and years of experience, to make the compiler produce really incomprehensible diagnostic messages... but I've never (cross finger) found one yet which google doesn't find some useful information on.
Cheers mate. Keith.Thank you for the nice welcoming.
(and Yeap, I guess it would had been much easier if the compiler just say +"You missed your 'new' keyword"+, instead of giving me +"Unidentified symbol and you will have no idea what I mean by that; have fun searching google all day long... GRIN*"+ error :) )

Similar Messages

  • My iphone doesn't recognize the user ID that the itunes account on my computer recognizes.  It was changed on the computer because the original user ID email address is no longer valid

    My ipone doesn't recognize the user ID that the itunes account on my computer recognizes.  It was changed on the computer because the original user ID email address is no longer valid.  Can someone please help me with this?  Thanks!

    Hi there,
    Thanks for the reply.  I did think that could be the case but then other books would also show up as apps on phone but not counted as an app.  Maybe book apps downloaded from the app store work in this way whereas books bought from the ibooks app show in ibooks and not as apps.
    I guess that would make sense, it must be because they are books but downloaded from the app store rather than the book store so they are visible as an app but don't actually get counted as an app.
    Would you think that's the case too?
    Thanks
    Adam

  • Java doesn't recognize VectorList methods

    I get the following error trying to use Vector methods.
    ----jGRASP exec: javac -g /home/eugene/javafiles/book.java
    book.java:20: cannot find symbol
    symbol  : method elementAt(int)
    location: interface java.util.List<java.lang.String>
                   temp += author.elementAt( i ) + " ";
                                 ^
    1 error
    ----jGRASP wedge: exit code for process is 1.
    ----jGRASP: operation complete.
    import java.util.*;
    public class book
         private String title = "";
    //     String author[] = new String[ 4 ];
    /* Make author private */
         List<String> author = new Vector<String>();
         String publisher = "";
         int isbn = 0;
         double price = 0;
         int stock = 0;
    /*  ---------------------------------------- HERE IS THE PROBLEM CODE --------------------------------------- */     
         String showAuthor()
              String temp = "";
              int i;
              for (i = 0; i < author.size(); i++)
                   temp += author.elementAt( i ) + " ";
              return temp;     
         String showTitle()
              return title;
         void changeTitle( String input )
              title = input;
         String showPublisher()
              return publisher;
         void changePublisher( String input )
              publisher = input;
         int showIsbn()
              return isbn;
         void changeIsbn( int input )
              isbn = input;
         double showPrice()
              return price;
         void changePrice( double input )
              price = input;
         int showStock()
              return stock;
         void changeStock( int input )
              stock = input;
         book( String title, String publisher, int isbn, double price, int stock, String ... author )
              if ( author.length > 4 )
                   throw new IllegalArgumentException( "You have too many authors" );
    //          else if ( author.length == 0 )
    //               throw new IllegalArgumentException( "You have no authors" );
              this.title = title;
              this.publisher = publisher;
              this.isbn = isbn;
              this.price = price;
              this.stock = stock;
              this.author = new ArrayList<String>( Arrays.asList( author ) );
         public static void main( String[] args )
              book test = new book( "title", "publisher", 123, 12.20, 4, "eugene", "vadim" );
              System.out.println( test.title );
    }

    yougene wrote:
         List<String> author = new Vector<String>();
    Since you explicitly defined your reference to be of type List<String> you can only call methods that List has. And elementAt(int) is a method that's not existing in the List interface.
    Use .get(int) instead.

  • What can I do when I try to access a URL and get the message "MAC OSX doesn't recognize internet addresses starting with "c:"?

    I recently tried to download a pdf file from a website in the UK.  Up popped a message saying the website could not be accessed, followed by this message: "MAC OSX doesn't recognize internet addresses starting with "c:".  I was able to access the website easily (its domain was "www") and the page listing the pdfs, but could not download a pdf.  Of course," c:" appears not to be a valid domain name, but why would anyone use "c:" in place of a domain name in their URL?  And what can I do about the problem?  I'm using Snow Leopard 10.6.8 and Safari 5.1.10, but also have Firefox and Chrome loaded.  Thanks.

    An address starting with c: wouldn't be any kind of domain name. C: is the drive lettering system DOS and and later uses. By default, A: and B: are reserved for your first and second floppy disk drive. All hard drives are then named C: through Z:, if you have that many. C: is normally your startup disk.
    Anyway, their PDF file is incorrectly linked to a file directly on the C: drive of someone's computer. It's not going to work no matter what you do.

  • I'm trying to e-mail music scores and audios, but I receive an error message saying Preview doesn't recognize the file format, regardless whether I use .mus, .pdf, or .mp3.  I haven't come across Preview or this problem before.  Any suggestions?

    I'm trying to send music, scores and audio, as e-mail attachments, with a copy to my e-mail address.  Whether I use .mus, .pdf, or .mp3, the error message says Preview doesn't recognize the file format.  I haven't seen Preview, or had any problems, before now.  Thanks for any suggestions.

    Hi,
    Firstly, your country is detemined by several factors, including your phone's regional settings, your SIM card and your NokiaAccount settings, if you used this phone whilst abroad then you may need to check that your regional and account settings are up to date since you have arrived in Canada.
    For services like Gigs, you should also ensure that the MixRadio app has access to your phone's GPS location as well as the main location being on in the phone settings. To check this, as well as Location being turned on in the phone settings, in MixRadio itself go to Settings>Location>On:
    The concern with favourites may also be related to location, if the music from certain artists is available in Canada but not where the service might think you are, availability of content may vary from region to region.
    If all settings in both the phone, your Nokia Account and the MixRadio app are correct, we may have to investigate deeper.
    It is impossible to comment on your camera without seeing it, you cold have the phone checked by Nokia Care locally, but of course if it was supplied in Europe it will be covered by the European Limited Warranty which is not valid in Canada.
    If this or any post answers your question, please remember to help others by pressing the 'Accept as solution' button.

  • Cannot launch SQL Developer - won't recognize Java JDK

    Upon attempting to launch SQL Developer for the first time, I get a dialog box asking for the "full path to Java executable". I use the Browse function to point to my local Java 7 JDK java.exe, and nothing happens. No error message, no prompt or hint (typical of Oracle applications, I'm discovering) - the dialog box clears itself and wil not accept any java.exe I point it to.

    DUPLICATE OF THIS THREAD!
    SQL Developer won't launch - doesn't recognize JDK
    Please mark this thread ANSWERED and continue to use the other thread.

  • Firefox will not recognize java plugin that has been installed and worked 1 day ago.

    I have an IMac with OSX 10.5.8, Firefox 5.0, One day ago it worked fine, today when going to a specific site that requires Java, Firefox will not recognize that Java is installed. I checked for updates and there are none. Java is installed and the site works fine with Safari, which requires Java as well. How can i get Firefox to recognize Java installation.

    Apple has removed support for the Java Plugin2 with the latest Java Update 10 for OS X 10.5 Java version, so the Java plugin is no longer available for Firefox versions and other browsers like Google Chrome that require the Java Plugin2.
    The Java Plugin2 plugin is still there, but he softlink to it has been removed with this update, so Firefox doesn't find the plugin.
    There will be fix for this in the next release (Firefox 5.0.1 or 6), so that Firefox will find the plugin again.
    I don't know if all Java applets will still be working on OS X 10.5 with that JP2 plugin (Apple recommends updating to OS X 10.6 for OS X 10.5 users with an Intel Mac).
    * [/questions/844734]
    * [/forums/contributors/707078]

  • Can't start emCCR - JAVA_HOME doesn't contain java

    Hi all,
    Just a quick question regarding a problem I'm recently having with the Oracle Configuration Manager. I have it setup normally to run every fifteen minutes as is the default, I believe in Oracle's docs. However, it's now bombing out complaining that JAVA_HOME doesn't contain java. Problem is, JAVA_HOME is setup to go where it always has been and it is correct. JAVA_HOME is currently set to "/u01/app/oracle/product/10.2.0/db_1/jdk/bin". This has worked in the past. I don't understand why emCCR is suddenly not picking this up. It does that even if i run emCCR interactively from a shell, just by running "/u01/app/oracle/product/10.2.0/db_1/ccr/bin/emCCR start". This directly contains the java executables as it always has. Does anyone have any ideas or has seen this before? Seems very strange to me - any help would be much appreciated.
    Thanks,
    dave
    Edited by: user2299875 on Sep 10, 2010 5:38 PM

    Hi,
    Before installing Oracle Configuration Manager, ensure that all the following pre-installation requirements are met:
    •You must ensure that the required JDK version (1.2.2 or later on Unix, and 1.3.1 or later on Windows) is present in the ORACLE_HOME directory of the system on which Oracle Configuration Manager is being installed or the JAVA_HOME environment variable is pointing to the appropriate JDK directory.
    •You must have your Customer Support Identifier (CSI) and your Oracle MetaLinkUserName with you as they are required when installing Oracle Configuration Manager in Connected mode.
    •You must specify a valid Country Code when installing Oracle Configuration Manager in Connected mode. Country codes are associated with the Oracle MetaLinkUserName. Refer to the Oracle Metalink site (http://metalink.oracle.com) if you encounter registration failures and are uncertain that the correct country code has been specified. The country associated with the Oracle MetaLinkUserName can be found in the Profile section under the Licenses link. For a list of valid country codes,
    see this link
    http://stanford.edu/dept/itss/docs/oracle/10gR2/install.102/e10041/install.htm

  • Parser doesn't recognize schema namespace

    I've got the following bit of code:
                    org.apache.xerces.parsers.DOMParser parser = new org.apache.xerces.parsers.DOMParser();
                    parser.setFeature("http://xml.org/sax/features/namespaces", true);
                    parser.setFeature("http://apache.org/xml/features/validation/schema", true);
                    parser.setFeature( "http://xml.org/sax/features/validation", true);
                    ErrorHandler handler = new MyErrorHandler();
                    parser.setErrorHandler(handler);
                    parser.parse(name);The schema file I want it to parse (and validate) is below. Its a simple example taken from the w3schools web site. I have almost no doubt the file is a valid schema file.
    <?xml version="1.0"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.w3schools.com"
    xmlns="http://www.w3schools.com"
    elementFormDefault="qualified">
    <xs:element name="note">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="to" type="xs:string"/>
            <xs:element name="from" type="xs:string"/>
            <xs:element name="heading" type="xs:string"/>
            <xs:element name="body" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
    </xs:element>
    </xs:schema>Below are the first few errors generated. The real head scratcher is having no clue about the URI I gave it, and then suggesting the SAME one as what I really should use. Getting these parsers setup to do validation has been a major pain. Anyone know what I left out?
    Error at 5 : org.xml.sax.SAXParseException: General Schema Error: Grammar with uri: http://www.w3.org/2001/XMLSchema , can not be found; schema namespace may be wrong: Xerces supports schemas from the "http://www.w3.org/2001/XMLSchema" namespace or the instance document's namespace may not match the targetNamespace of the schema.
    Error at 5 : org.xml.sax.SAXParseException: Element type "xs:schema" must be declared.
    Error at 7 : org.xml.sax.SAXParseException: Element type "xs:element" must be declared.

    Thanks for the replies, but I don't think we are quite connecting. I do eventually want to be able to validate an XML file against a schema (which I can't do either), but first I want to be able to validate the schema file itself; i.e. to confirm that the schema I designed is a valid schema file. As I understand it, it should be possible to tell the parser that the schema to validate against is the "schema for writing schemas", http://www.w3.org/Schema/schema.xsd (or whatever it is). That's where I'm getting stuck, that the parser doesn't recognize the elements for actually defining a schema.

  • Forte doesn't recognize classes are compiled

    In the Sun One Studio 4 Update 1 IDE, my Java source files are displayed in the Explorer window with the uncompiled badge icons next to them, even though the classes are already compiled. If I select a file to compile it, the IDE will compile it, and put the compiled class in the target directory correctly. But the uncompiled icon is still displayed. If I select the file again and compile, the IDE compiles it again, instead of giving me the message that the file is up to date.
    Has anyone seen this problem?

    Add the output dir to classpath.Did you ever use forte? It doesn't recognize classpath. It looks at the mounted directories and jars instead. And I do have the output dir mounted - otherwise, the compiler couldn't put the compiled classes in the right place.

  • Jar doesn't recognize another jar

    Hi I packed my java class and additional files into a jar file, using the eclipse.
    The class I packed uses another jar file. it works fine.
    the problem is with my new jar that I created, since it doesn't recognize the other jar that the class uses and can't use it,
    Although I included the other jar in my class path in the eclipse.
    i don't know how to make that the new jar will know the other jar.
    thanks.

    gimbal2 wrote:
    ...Jar files have their own classpath that you cannot override. ...Since you have provided the correct strategy to pursue in this instance, I will simply point out (OP please stop reading ..now!) that it is possible to side step the default behaviour of the -jar option by not including that option when starting an app.
    E.G.
    prompt:java -jar main.jar
    NoClassDefFoundError Other.class
    prompt:java -cp main.jar;other.jar com.our.main
    Other.class processing..

  • I am unable to rent movies, it doesn't recognize my ID.  Could it be because I am registered on US site but live in Canada?

    I am unable to rent movies, it doesn't recognize my ID.  Could it be because I am registered on US site but live in Canada?

    Welcome to the Apple Community.
    You can only use an iTunes store in a location for which you live and have a valid address for your credit card.

  • HT203177 Time machine doesn't recognize my hard drive archive

    I have time machine archive on a hard drive (not time capsule). It recently stopped backing up. On checking, time machine recognizes the hard drive (in preferences it is listed as the back up drive.) The files appear to be present on looking into the drive, but Time Machine doesn't recognize that there are backup files there, it wants to complete another full backup. Meaning - it says for latest backup: "none".
    I am afraid if I do another full backup, I will lose the ability to access the older backups.
    When I try to access older files through time machine, it predictably cannot find them.
    How do I tell Time Machine that the files on that hard drive are the backup files?

    Update:
    1) Right click on TM icon - Menu choice "Browse other TM disks" allows me to see the data - i.e. it is a valid TM archive, not corrupted.
    2) Looking at TM preferences immediately after showed the proper disk was targeted, but still Latest backup: None.
    3) Shut down, anomalous shut down -required power button hit. (AHH - the problem??)
    4) restart using command  - R  works - i.e recognizes the disk and emergency recovery system software
    5) Restart - Still shows latest backup: None
    6) trying to access data through standard TM startup shows data now.
    7) go back to preferences - still no backup shown.
    Aside - I can't recall what the purple vs white dates on right side of the screen signify, and can't find it in the documentation right now. Anybody know?

  • HT201274 attempted to download new ios 6 software. wiped out sim card and computer doesn't recognize iphone now. blinking apple icon is only thing I get

    Need help with iphone 4. tried to download new software and it zorked sim card and phone. Only get a blinking apple icon. Computer doesn't recognize iphone so I can't restore

    Hello henry lfrommiami,
    Thanks for using Apple Support Communities.
    To troubleshoot this issue where your iPhone gives you the message "No SIM Card installed" please follow the steps below.
    Update your iPhone to the latest version of iOS.
    Turn airplane mode on and then off again.
    Restart your iPhone.
    Check for a carrier settings update. Go to Settings > General > About. Install any available update.
    Remove the SIM card and make sure that it's a valid SIM that your carrier provided. Also make sure that it's not damaged, worn, or modified. Then reinsert it.
    A SIM tray that comes with one iPhone model won't necessarily work with a different iPhone model. When you insert the correct SIM tray, the SIM tray should be flush with the device.
    If you have another SIM card, insert it. You can use a SIM card from any phone with the same format as your iPhone SIM card. If your iPhone works with that SIM card, contact the carrier that issued your original SIM card.
    Restore the iPhone.
    If you still see the issue, contact Apple support.
    If you see 'No SIM' alert on iPhone
    Cheers,
    Alex H.

  • Eclipse doesn't recognize TomEE

    According to 'TomEE and Eclipse' on Apache's website, it should be easy to run TomEE on Eclipse. I downloaded version 1.7.2 of TomEE-webproject from TomEE's download section and unpacked it in my home directory, as described in the YouTube-video on 'TomEE and Eclipse', and tested by running ~/apache-tomee-webprofile-1.7.2/bin/startup.sh. When navigating to localhost:8080, everything seems fine (the page displays "Apache Tomcat (TomEE)/7.0.62 (1.7.2)").
    However, when trying to install a new server in Eclipse, by choosing New Runtime... in the new Dynamic Web Project dialog and browsing for a Tomcat 7.0 directory, I can't select the root of the tomcat-webprofile directory (Eclipse complains that "unknown version of Tomcat was specified") and 'Finish' remains grey (and a Tomcat version is suggested to download and install). Apparently, Eclipse doesn't recognize the TomEE directory as a Tomcat directory.
    I'm using Eclipse 4.5.0 (Mars) in Arch Linux. Tomcat 7 and 8 installed by the system are correctly recognized.
    NOTE: Sorry for not including hyperlinks, but I'm not yet allowed to post links to non-eclipse.org sites.

    On 08/03/2015 12:24 PM, Marcel Korpel wrote:
    > [snip]
    > To be frank, I got a bit irritated by bad support of Eclipse for servlet
    > containers capable of JSF (if I'm clear; tried Glassfish but got tons of
    > NullPointerExceptions) and Maven problems, so now I'm trying NetBeans +
    > Glassfish, which work fine, so far. The IDE is not as neat and
    > configurable as Eclipse, but they work fine together.
    Marcel,
    A few years ago, I took some careful notes as I made my way through some
    JSF stuff. While I experienced some frustration, it was more with the
    general Faces community and not at all with Eclipse. I would have said
    then that Eclipse was just the table top; the different Faces proposals
    (Rich, My-, etc.) were frustratingly documented, ill available, hard to
    find a complete set, etc. It's not so much Eclipse's fault.
    I assume you downloaded Eclipse IDE for Java EE Developers. I used just
    plain Tomcat.
    In any case, and I know these notes are several years old, feel free to
    look through them for any help or clues you might find (bottom/middle
    half of left column).
    http://www.javahotchocolate.com/topics.html
    Lars Vogel's got some great tutorials on web programming including
    Tomcat and JSF:
    http://www.vogella.com/tutorials/web.html
    Hope this helps and doesn't confuse.
    Cheers

Maybe you are looking for

  • Single Sign On - SAPSSOEXT - Can't find Dependant Libraries

    HI   I am trying to implrement SSO to another server running in IBM Websphere 5.1 In my java code System.LoadLibrary fails for SAPSSOEXT and error message is "Can't find Dependant Libraries" concerned java code is public static String SSO2TICKETLIBRA

  • Just Paid for CC, Installed Premier, But It's Trial... Why?

    First thing I did was to download Photoshop, which works fine. Then I downloaded Premier, which started in trial mode. Why is this? How can I solve this?

  • Manage security for a report that lives in multiple folders

    Post Author: EricE CA Forum: General I am using Crystal Enterprise 10.  (we are about to upgrade to BO XI if it matters in the answer) As we consider the migration to XI we are thinking about problems with our existing system that we have never solve

  • Information only on the first page

    Hi, How do I print a portion of the xml only on the first page of the invoice. I am assuming this portion that need to appear on the first page should be put into the footer. But how can I exit out of a loop that is populating the body of the first p

  • Can I replace the aluminum outer case the laptop comes in?

    I have a macbook pro 17" 2009 Processor  2.66 GHz Intel Core 2 Duo Is it possible to replace the aluminum outer case the laptop comes in? My wife was using my mac and droped it, on the front left corner there is a dent, and it is affecting my CD's th