Static import from SE5 (Ex 16 on p. 91 in Thinking in Java Edn 4 by Eckel)

The following line of code is underlined:
import static net.mindview.util.Print.*;with this error displayed:
static import declarations are not supported in -source 1.4
(try -source 1.5 to enable static import declarations).
My Path variable contains these:
C:\Program Files\Java\jdk1.6.0\bin;C:\Program Files\Java\jre1.6.0\bin;D:\java\TIJ4\code
D:\java\TIJ4\code is the root folder for net.mindview.util.Print.
JRE1.6 and JDK1.6 are installed.
I also have:
i.e. a dot, in my CLASSPATH variable.
This is from the 4th edn of Thinking in Java by Bruce Eckel. If you are or have been through this stuff I would really appreciate it if we could meet on Skype every now and then to talk about issues like the one described above.
Thanks for your help,
b

Now same code is underlined:
import static net.mindview.util.Print.*;but with this error message:
package net.mindview.util does not exist
However it is mapped like this:
D:\java\TIJ4\code\net\mindview etc..
So, I have put this in to the Path variable:
D:\java\TIJ4\code because it is the root folder of net.mindview.util.
Is there something else I should do? Is is ok to have a non C directory in the Path variable?
Thanks for any help,
B

Similar Messages

  • Using static import

    I just downloaded the 2.2ea. I tried using the static import feature. When I try to import my own classes f.ex.
    import static test1.test2.TestInferface;
    i get the error
    cannot find symbol
    symbol : class test2
    location: package test1
    import static test1.test2.TestInferface;
    ^
    if I try the static import from the example
    import static java.lang.Math.*; // import static
    it compiles fine. What have I got wrong here?

    Doh, you were right :). Importing test1.test2.TestInterface.*; is what is needed. Works now. Thanks.
    Thought I had already tried that but I guess I was wrong. I guess I was too stuck in the old way of thinking of importing classes and interfaces as a whole, I guess the static import imports class and interface members then.. Am I right?

  • Static Noise from Imported Songs

    I imported songs from my CDs using iTunes 7 and it created some static noise in some songs. I doesn't do that for every song, maybe one in every ten songs, but it is frequent enough to bother me.
    When I imported same songs using Music Match program and manually added them to iTunes, I don't hear any static noise.
    Any idea to solve this problem? Thanks.

    I too have this problem. This used to be the case with both Windows Media Player and iTunes. So, I updated my Windows Media Player to version 11 and overcame this problem in the windows side of things. I then import from the Windows Media Player or WMA format to iTunes 7 and do not have static. My problem began once my son imported his Wierd Al Yankovick CD directly to iTunes. Now every cd comes in with static. I still cannot import directly from CD to iTunes 7. And, yes, I do have the latest version. We should be able to do this directly.
    Any advice from anyone out there in Apple land as to make iTunes import correctly?
    Dell   Windows XP  

  • Frequent static electricity from my iPhone 6

    I kept getting static electricity from my iPhone 6, just holding it on its own (ie not whilst charging the battery) as I type my texts or browsing the Internet. It hasn't got a casing on. Is this normal? It's happening quite frequently, and it's quite disturbing.

    HI
    I contacted Apple & did as below as advised & I got my contacts back.
    Before I started I made sure that I had  a Icloud backup for my IPhone ( which was before the problem started ).[ Settings > ICloud > Backup. ]
    IPhone reset - by 'Erase all contents & settings...
    after the phone starts, choose to restore from Icloud backup.. & choose the Backup you think is without the issue.
    VERY IMPORTANT.. Once the phone restores from the backup & the Home screen comes, put the phone in Airplane mode Immediately.
    Now go to settings > Icloud > put the contacts OFF. ( Keep the contacts )
    Now OFF the Airplane mode & go to settings > Icloud > put the contacts ON & select Merge.
    I got all my contacts back which was there until that Backup.
    Thanks again  - Apple support.

  • Static import of member of class in same unnamed package fails

    I think I found a bug in the JDK 1.5 (Tiger) javac compiler. It involves static import and unnamed packages.
    Consider the following compilation unit:
    import static D.x;
    class C {
        int foo() { return x; }
    class D {
        static final int x = 1;
    }Running javac from the Tiger beta 2 SDK generates the following output:
    Test.java:1: cannot find symbol
    symbol: class D
    import static D.x;
                  ^
    Test.java:1: static import only from classes and interfaces
    import static D.x;
    ^
    Test.java:4: cannot find symbol
    symbol  : variable x
    location: class C
        int foo() { return x; }
                           ^
    3 errorsIn my opinion, this is a bug. This compilation unit should compile without errors.
    Note that the following compilation unit compiles without errors with Tiger beta 2:
    package p;
    import static p.D.x;
    class C {
        int foo() { return x; }
    class D {
        static final int x = 1;
    }Note that this issue is distinct from the issue of importing a class from an unnamed package into a named package. I totally agree that the latter is not allowed. However, the current issue is a different matter, since here I am importing members from the same package (which happens to be an unnamed package).

    The unnamed package feature is deprecated. Even if this is a bug (which I sort of doubt), this may never be fixed.

  • Static Import question

    It is a very easy (down to earth) question.
    Are static imports of methods having the same name as
    Object methods forbidden?public class StaticUse1 { 
      public static boolean equals(StaticUse1 su1,StaticUse1 su2) {
        return true;
      public static boolean equal(StaticUse1 su1,StaticUse1 su2) {
        return false;
    }An import somewhere else:import static apackage.StaticUse1.*;
    public class Test {
      public static void main(String[] args) {
        //System.out.println(equals(new StaticUse1(),new StaticUse1()));  // error
        System.out.println(equal(new StaticUse1(),new StaticUse1()));
    }Compiler complains about ... equals(java.lang.Object) ...

    Such static imports are allowed, but they won't work because of the scoping rules of the language. The equals(Object) for the current class always shadow such methods from the static import.

  • Static import bug?

    Hey just discovered something new...does this sound like a bug to you guys?
    I have a class with a static method called, say, omgMethod()
    and I have another class with a method (not static) with the same name (omgMethod) but different signature.
    now when I try to use import static classA.omgMethod in the second class, it generates a compiler error:
    cannot find symbol method omgMethod( etc...)
    any thoughts? i'm thinking about adding it to the bug report.
    -Cuppo

    I'm not so sure about that. I have never used static import so I checked out Sun's tutorial which is here:
    http://java.sun.com/j2se/1.5.0/docs/guide/language/static-import.html
    It talks about importing "members" and says you can import "members" individually. And (I had to look this up too in the JLS), "members" means classes, interfaces, fields, and methods.
    So that says to me that you can indeed import a static method from another class, and then use it without qualification. Yeah, I'm surprised too. But you're just importing the method's name, not its signature. So if that name conflicts with a name of a method in your class, then I don't know what is supposed to happen. I looked through the JLS a bit and section 6.5.7.1 says
    "The Identifier must name at least one visible (�6.3.1) method that is in scope at the point where the Identifier appear or a method imported by a single-static-import declaration (�7.5.3) or static-import-on-demand declaration (�7.5.4) within the compilation unit within which the Identifier appears.
    See �15.12 for further discussion of the interpretation of simple method names in method invocation expressions."
    Possibly section 15.12 discusses conflict resolution in this case. But I will let you carry on from there.

  • When I try to print a drawing imported from my ipad iphoto crops it. Is there any way to stop this?

    When I try to print a drawing imported from my ipad iphoto crops it. Is there any way to stop this?

    Usual cause: printing at the wrong aspect ratio for the image - trying to print 5 x 3 in the shape of a 6 x 4 for instance.
    Regards
    TD

  • I want to remove all of my photos out of iPhoto there are approximately 35000 some imported from an old hard drive and a SD Card from my Nikon D500 how do I do this

    I want to remove all of my photos out of iPhoto there are approximately 35000 some imported from an old hard drive and a SD Card from my Nikon D500 how do I do this?
    I have iPhoto version 9.1.5 (615)
    Mac OS X version 10.6.8
    I want to do this because when I imported from my old hard drive there was an error message stating that 12 photos were not imported as the programm did not recognise the format even though they were jpegs like the other photos in that particular album. The dates of the photo folders are wrong I have multiple copies of photos and every time I start iPhoto I get the following message 12 photos have been found in the iPhoto library that were not imported would you like to import them No or Yes
    if you press Yes the same message comes back again and if you press Yes again the program flicks to last import for 2 seconds and then opens events.
    if you press No the message The photos have been placed in the folder/user/judith/pictures/iphoto Library recovered photos then if you press OK the original message 12 photos have been found.............
    if you press No at this point the message The photos have been placed in the folder/user /judith/pictures/iphoto Library recovered photos_11 the end number goes up by 1 every time you go through this process
    Any help would be greatly appreciated

    Did you import an iPhoto Library from the old Hard Drive? Do you still have that old Library?
    The way to clear out a Library is to Export the photos - Apps like iPhoto2Disk or PhotoShare will help you export to a Folder tree matching your Events.
    For the annoying start-up message:
    Go to your Pictures Folder and find the iPhoto Library there. Right (or Control-) Click on the icon and select 'Show Package Contents'. A finder window will open with the Library exposed.
    Look there for a Folder called 'Import' or 'Importing'.
    Drag it to the Desktop. *Make no other changes*.
    Start iPhoto. Does that help?
    If it does then look inside that folder on your desktop. Does it contain anything you want? If not you can trash the folder.

  • Comments not imported from Data Dictionary of SQL Server. SDDM 3.3.0.747

    Hi,
    SDDM 3.3.0.747 32-bit on Windows 7 64-bit.
    Comments are not imported from Data Dictionary of SQL Server 2008. Connection through Microsoft JDBC Driver 4.0 for SQL Server or jTDS 1.2.7
    What I have tried? In SDDM DDL generation, Comments in DBRMS for SQL Server are generated with "EXEC sp_addextendedproperty 'MS_Description' , 'Test Comment' ..." so I added extended property named "MS_Description" into SQL Server database, both on table and column. None of them were imported from Data Dictionary into SSDM. I have tried both drivers stated above. Is it a bug or am I missing something?
    I've found similar question thread Re: Data dictionary import doesn't import column comments for SDDM 3.0.0.665, so I guess it is a bug when importing with JDBC drivers.
    MiGli
    Edited by: MiGli_1006342 on May 25, 2013 8:32 AM
    Edited by: MiGli_1006342 on May 25, 2013 9:02 AM

    Extended properties were not imported correctly from SQLServer databases at DM 3.3.0.747.
    Calls to sp_addextendedproperty and fn_listextendedproperty have been modified.
    I don't think it is a problem with JDBC drivers.
    A bug fix should be available in the next release of DM.

  • SQL modeler can not import from data dictionary

    It was very frustruted to see that the SQL Modeler hang in import from data dictionary of a database as part of revise engineering. I have to question myself if sql modeler is a serious tool and should I give up.

    I am not sure if Data Modeller is still in Beta./Production. First couple off initial versions of a new product are normally buggy.
    Regards
    Alternatively, If this product is still in Beta, then you can contact the development team or report the issue so that they can take care of this issue in next beta release.
    Edited by: skvaish1 on Mar 30, 2010 3:18 PM
    Edited by: skvaish1 on Mar 30, 2010 3:26 PM

  • Unable to Import from my Canon DC220 camcorder...

    I had begun a project with I-movie 6 of which my camcorder was not compatible with...my solution was to upgrade to I-Movie 08 of which the Canon DC220 is compatible with and I-Movie should import from (http://docs.info.apple.com/article.html?artnum=306171). Unfortunately, when I plug my Camcorder into the USB and switch it to PC/Computer mode, I get a pop up on the screen stating that I "inserted a Blank DVD" and gives me a few options on how to proceed. I did try to use other USB ports on the Mac...nothing. I did try a couple different DVDs of which I recorded on...nothing. So I was able to eliminate the problem being with the DVD or the USB port I was using. Please advise as I am at a loss. Thanks so much.

    Unplug your USB cable and then press func. to enter the menu on your camera.
    plug in your cameras power supply. Then select Finalize. This will close the disc and prepare it for importing.
    I'm still having trouble, but this is a step you must follow.

  • Data import from EBS failed via FDMEE in fdm . Getting error message as "Error connecting to AIF URL.

    FDM Data import from EBS failed via FDMEE after roll back the 11.1.2.3.500 patch . Getting below error message in ERPI Adapter log.
    *** clsGetFinData.fExecuteDataRule @ 2/18/2015 5:36:17 AM ***
    PeriodKey = 5/31/2013 12:00:00 AM
    PriorPeriodKey = 4/30/2013 12:00:00 AM
    Rule Name = 6001
    Execution Mode = FULLREFRESH
    System.Runtime.InteropServices.COMException (0x80040209): Error connecting to AIF URL.
    at Oracle.Erpi.ErpiFdmCommon.ExecuteRule(String userName, String ssoToken, String ruleName, String executionMode, String priorPeriodKey, String periodKey, String& loadId)
    at fdmERPIfinE1.clsGetFinData.fExecuteDataRule(String strERPIUserID, String strDataRuleName, String strExecutionMode, String strPeriodKey, String strPriorPeriodKey)
    Any help Please?
    Thanks

    Hi
    Getting this error in ErpiIntergrator0.log . ODI session ID were not generated in ODI / FDMEE. If I import from FDMEE its importing data from EBS.
    <[ServletContext@809342788[app:AIF module:aif path:/aif spec-version:2.5 version:11.1.2.0]] Servlet failed with Exception
    java.lang.RuntimeException
    at com.hyperion.aif.servlet.FDMRuleServlet.doPost(FDMRuleServlet.java:76)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

  • IPhone won't play music imported from CDs or mp3s not downloaded from itunes

    When I first downloaded iOS 7, all of the music I had in my iTunes synched to my iPhone, but now new CDs I just imported and previous songs I imported from CDs won't synch (I've tried over wifi and usb).  When I click on songs on my phone that were from CDs, they look as if they are going to play and then skip immediately.  Mp3s I downloaded do the same thing.  Mind you, everything was working fine until updating to iOS 7.0.4.  I've been looking around the forums and have found that problems like this are relatively common and it's a shame Apple hasn't done anything to fix it.
    When my phone is hooked up and I click on "on this iPhone", it says the music from CDs and mp3s is on, but the titles come up gray with these litte circle things next to them
    Just checking now, I noticed some songs I bought from iTunes are doing the same thing.
    I tried manually synching, but when I click to drag the songs into my phone, the section that has music, movies, etc. just flashes and nothing happens.  I know something is wrong because I just put a ringtone onto my phone the same way.
    Oh, I also noticed that when my iPhone is synching and the steps go through at the top it skips steps 3, 4, and sometimes 5 (The Apple symbol pops up instead then goes straight to 6 and 7) so I know it's not recognizing the fact I put a bunch of new music in iTunes. Also, when I look at the bar at the bottom that shows how much memory is on my phone, this shows up:
    and that Documents and Data thing was not there before.
    Can someone please give me ideas on how I can stop this rediculousness without buying a new phone?

    Did you already try the suggestions mentioned in this article?
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases

  • This Question is at least 2.5 years old.  But still an issue.  I have an early 2008 and mid 2010 13 inch macbook pro running iTunes 10.7.  Itunes on both machines doesn't recognize blank cds or allow me to import from a music cd when I insert it.

    I have an early 2008 and mid 2010 13 inch macbook pro running iTunes 10.7.  Itunes on both machines doesn't recognize blank cds or allow me to import from a music cd when I insert it.

    iTunes does not use the .xml it uses the .itl
    If you are sure your old library file migrated across (does the file size and modification dates suggest it has?) start iTunes while holding down the option/alt key and guide it to the .itl file to get it to use that one.

Maybe you are looking for