Source level?

Hello,
I have small problem with JSP. I tried to solve it out by myself but i didn't succeed.
Error message:
for-each loops are not supported in -source 1.4(try -source 1.5 to enable for-each loops)
I use netbeans editor. I have source level set to 1.5, but still i have this error.
any suggestions?
thanks in advance.
Message was edited by:
n3m

my problem is now resolved. i think it is because of NetBeans carrying over incompatible project meta-data from previous sessions run with (not so much) older version of NetBeans .
To recap:
I was using an older version of NetBeans yesterday and was able to build and run my simple application. When I introduced a statement that uses the new form of foreach loop, it started complaining about the for loop and source-level not being 1.5.
Thats when I re-downloaded the latest NetBeans (JDK 5.0 Update 7 with NetBeans 5.0 Bundle). Still had the same error.
Then I tried a brand-new simple app using the same new foreach construct, and it worked!
Suspecting the project meta-data, I used Windows explorer and deleted all the meta-data manually. Then I typed in my source code afresh and voila, the app started working!
Clearly, NetBeans is trying to re-use incompatible project meta-data from the previous NetBeans sessions.

Similar Messages

  • Error about Source Level only if 5.0?  I'm using Java 1.6?  Maps

    Hello everyone. I was just trying to run some simple Source Code from my book here:
    package mapa;
    import java.util.HashMap;
    import java.util.Map;
    import java.util.Set;
    public class MapTest
         Map<String, String> phonebook = new HashMap<String, String>();
        // constructor
        public example2(String n[], String nums[]) {
           for(int i=0; i< n.length; i++)
               phonebook.put( n, nums[i] );
    public static void main(String[] args) {
    // data
    String [] names = { "Lefty", "Guarav", "Wong", "Rupamay" };
    String [] extns = { "4873", "4810", "3769", "0" };
    // get an instance of this class
    example2 ex = new example2( names, extns );
    // dump out the map
    System.out.println("map: " + ex.phonebook);
    // get the mappings
    Set<Map.Entry<String,String>> s = ex.phonebook.entrySet();
    // iterate over the mappings
    // for (Iterator i = s.iterator(); i.hasNext(); ) {
    for (Map.Entry me : s) {
    Object ok = me.getKey();
    Object ov = me.getValue();
    System.out.print("key=" + ok );
    System.out.println(", value=" + ov );
    and i'm getting the following errors when I run it in Eclipse:
    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
         example2 cannot be resolved to a type
         example2 cannot be resolved to a type
         Syntax error, parameterized types are only available if source level is 5.0
         The type Map.Entry is not generic; it cannot be parameterized with arguments <String, String>
         Syntax error, 'for each' statements are only available if source level is 5.0
         at mapa.MapTest.main(MapTest.java:24)Line 24 is:
      example2 ex = new example2( names, extns );I've compiled things with Eclipse before such as Networking programs and they worked fine, not sure whats wrong with this example.
    Thanks!

    Oops it looks like on that line they are using the Class itself, and they had it renamed to Example2 not MapTest. I changed the code to the following but still getting errros:
    package mapa;
    import java.util.HashMap;
    import java.util.Map;
    import java.util.Set;
    public class MapTest
         Map<String, String> phonebook = new HashMap<String, String>();
        // constructor
        public example2(String n[], String nums[]) {
           for(int i=0; i< n.length; i++)
               phonebook.put( n, nums[i] );
    public static void main(String[] args) {
    // data
    String [] names = { "Lefty", "Guarav", "Wong", "Rupamay" };
    String [] extns = { "4873", "4810", "3769", "0" };
    // get an instance of this class
    MapTest ex = new MapTest( names, extns );
    // dump out the map
    System.out.println("map: " + ex.phonebook);
    // get the mappings
    Set<Map.Entry<String,String>> s = ex.phonebook.entrySet();
    // iterate over the mappings
    // for (Iterator i = s.iterator(); i.hasNext(); ) {
    for (Map.Entry me : s) {
    Object ok = me.getKey();
    Object ov = me.getValue();
    System.out.print("key=" + ok );
    System.out.println(", value=" + ov );
    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
         The constructor MapTest(String[], String[]) is undefined
         ex.phonebook cannot be resolved or is not a field
         Syntax error, parameterized types are only available if source level is 5.0
         The type Map.Entry is not generic; it cannot be parameterized with arguments <String, String>
         ex.phonebook cannot be resolved or is not a field
         Syntax error, 'for each' statements are only available if source level is 5.0
         at mapa.MapTest.main(MapTest.java:24)

  • Syntax error: annotations are only available if source level is 5.0

    In eclipse, I am trying a hello world JMS tutorial.
    In the code below, it doesn't like the @ sign for some reason... And I don't know how to make it happy....
    It give this error:
    Syntax error: annotations are only available if source level is 5.0
    --------------code------------
    public class MessageSender {
       @Resource(mappedName = "jms/GlassFishBookConnectionFactory")
       private static ConnectionFactory connectionFactory;
    Here is my path if that helps.
    Path=C:\oracle\product\10.2.0\client_1\bin;C:\Program Files (x86)\Java\jre8\bin;c:\glassfish4\glassfish\bin;C:\Program Files (x86)\Java\jdk1.8.0\bin
    Thanks for any leads!
    Jim

    It give this error:
    Syntax error: annotations are only available if source level is 5.0
    That exception is telling you that the java compiler version being used to compile your java source is not 5.0 or later.
    Eclipse uses 'some' version of Java to run itself. And, by default, your java code will use that same version of java unless you configure it to use a different version.
    http://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM
    One of the most recommended options to use is to specify a specific JVM for Eclipse to run on. Doing this ensures that you are absolutely certain which JVM Eclipse will run in and insulates you from system changes that can alter the "default" JVM for your system. Many a user has been tripped up because they thought they knew what JVM would be used by default, but they thought wrong. eclipse.ini lets you be CERTAIN.
    Check the version of java that eclipse is using. Just because that version of java is not on your path doesn't mean eclipse isn't using it.
    Then repost your question in an eclipse forum.

  • Problem with setting Source Level in Sun Studio 2

    I've got problem with setting Source Level to 1.5 in Sun Studio 2. When I try to set it to 1.5 in Project properties and click Ok everything seem to go well, but when I open Project Properties again Source Level is set to 1.4. I need this to work cause I started to lear Java recently and I want to use foreach loop.
    Please help

    I'm just citing an example using Date().
    In fact, whether I use DateFormat or Calendar, it shows the same result.
    When I set the date to 1 Jan 1950 0 hours 0 minutes 0 seconds,
    jdk1.4.2 will always return me 1 Jan 1950 0 hours 10 minutes 0 seconds.
    It works correctly under jdk1.3.1

  • How to change the source level in java Studio creator

    Hi,
    I am using Sun Java Studio Creator 2 Update 1 IDE, in this IDE how to change the source level to 1.5 for an existing project.
    Thanks in advance,
    Rajesh.

    Hi!
    Unfortunately Sun Java Studio Creator 2 Update 1 doesn't support 1.5 source level. But You can try to download NetBeans IDE (from http://www.netbeans.org) and there with Visual Web project You will find the same functionality as for Creator. And 1.5 source level is supported by NetBeans.
    Thanks,
    Roman.

  • JSC2: Source level problem

    Dear members,
    I am trying to complete this code in JSC1:
    public Map<String, Object> listBoxMap;
    and i am getting following compilation error
    generics are not supported in -source 1.4
    (try -source 1.5 to enable generics)
    i tried to change the source level in project.property file from 1.4 to 1.5 but when i restart IDE; it recognize the change and set it back to 1.4.
    I searched on forums as well to find out the solution of this problem and came across a statement that JSC2 does not support source level 1.5 but the post was actually posted back in July 2006.
    Does anybody know the solution of this problem or has SUN fixed this problem ?
    Regards,

    Goodness! This is the very reason I switched from SJSC2 to Netbeans 5xx about a year ago! I thought by now the server issue (only allowed 8x then) and the JDK version would be taken care of by now. Tough eih?
    In Netbeans 5.5.1, you can attach the Sun Java System Application Server 9 (update 3 if you wish) and use JDK source 6 (with Update 1 if you wish), hassle-free. Depending at the stage you are at development-wise, you may want to consider experimenting, but probably wait for a few more responses as there may be a quick fix to your issue.

  • [svn] 1363: 1) update the qa-regress build file to use 1.5 source level

    Revision: 1363
    Author: [email protected]
    Date: 2008-04-23 14:02:19 -0700 (Wed, 23 Apr 2008)
    Log Message:
    1) update the qa-regress build file to use 1.5 source level
    2) remove the duplicate MBeanServerGateway destination
    3) remove a comment from the mxml
    Modified Paths:
    blazeds/trunk/qa/apps/qa-regress/WEB-INF/flex/remoting-config.mods.xml
    blazeds/trunk/qa/apps/qa-regress/build.xml
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/proxyService/httpservice/MultiHe aderTest.mxml

    Hi,
    If you remove the $ and braces (as shown below) it will work.
    <data-source-aliases>
    <aliases>
    <data-source-name>MYDS</data-source-name>
    <alias>BRANCH50DS</alias>
    </aliases>
    </data-source-aliases>
    Regards,
    S.Divakar

  • Kernel source-level debugging

    Is any source level debugging available for Solaris 2.8? Does anyone actually have ksld working, or does Sun not support it anymore because it doesn't work? I have been happily using kgdb for many years on 2.6,but now have been forced to upgrade to 2.8,and there doesn't seem to be anything available. If anyone has ksld working and would be able to send me a copy, please reply

    KSLD did work at one time with Solaris 8. I don't know about its current status. I no longer see it listed at http://soldc.sun.com/developer/support/driver/tools/tools.html, so that is not a good sign.
    KSLD was developed by a group outside the regular Solaris kernel group and without proper architectural oversight. Other debugger development groups also exist with different ideas about what is desirable in a kernel debugger. This resulted in friction between various groups. My guess would be that KSLD is not supported at this time and may or may not be coming back.
    Richard

  • Data Source Level SRS (SSRS) Issue - Permissions granted to user... are insufficient for performing this operation. (rsAccessDenied)

    I've inherited a bit of a security issue and would appreciate any insight.  
    The bottom line is that I have a user than can run one report from folder "X", but not the report next to it.
    Here is the problem context.  The names are changed to protect the innocent.  Sharepoint is not involved.
    The SSRS Home Folder has Security "Group or User" of "DomainX\SSRS_Browsers"   with Role(s) "Browser"
    "SSRS_Browsers" is an AD group.  The user with the issue (DomainX\UnhappyUser) is a member of this group.
    The user is able to navigate to folder "X" (one level below Home) and run Report "A" successfully.  But, when they try to run report "B", they get: 
    "An error has occurred during report processing. (rsProcessingAborted)  The permissions granted to user "DomainX\UnhappyUser" are insufficient for performing this operation. (rsAccessDenied)
    The difference between report "A" that works, and report "B" that doesn't is that report "B" references a data set from a different data source.
    Both reports reference DataSource1.  The failing report additionally references DataSource2.   The SSRS logs confirm this is where the problem is:
    ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: , Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user 'DomainX\UnhappyUser' are insufficient for performing this operation.;
    processing!ReportServer_0-34!c58!07/16/2014-16:45:41:: e ERROR: An exception has occurred in data set 'DataSource2'. blah blah blah
    Both data sources have "stored" credentials with the same AD user: "DomainX\SSRS_Reports".  Both data sources reference the same instance of SQL Server.  They do have different "Initial Catalog" values.  (DatabaseA
    and DatabaseB).  I can run both reports successfully, but I more authority.
    "SSRS_Reports" is defined as a "Login" user under "Security" in SSMS at the instance level.  The Server Role is "public".
    DatabaseA (which is behind the data source that works) has Security->Users->DomainX\DataBaseA_Readers.   This is an AD group, that includes has "SSRS_Reports" as a member.
    DataBaseA_readers (in SQL Server, at the DatabaseA level) is a member of role db_datareader.
    DataBaseB (which is behind the data source that fails) has Security->Users->DomainX\DataBaseB_Readers.  This is also an AD group, that includes "SSRS_Reports" as a member.
    DataBaseA_readers (in SQL Server, at the DatabaseB level) is a member of role db_datareader.
    Does anyone have any insights as to where my problem may be?
    Thank you.  Sorry for the verbosity.  

    Hi Steve,
    After testing the issue in my local environment, I can reproduce it. The Home Folder has Security for "DomainX\SSRS_Browsers" group with "Browser" Role, the folder “X” and Report “A” security is inherited from its parent item, but the Report “B” Item security
    is not inherited from its parent item. In this way, the DomainX\UnhappyUser has insufficient permission to render the Report “B”.
    So, please try to check the Security page of Report “B” and compare it with Report “A” security settings. If possible, we can click “Revert to Parent Security” button to replace all the defined security settings with the security settings of its parent folder
    ”X”.
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Regarding 0txtmd field mapping in Transfomration level dso to cube

    Hi All,
            When I was creating transformations from my dso to cube,I faced a problem where I did not get a infoobject field 0TXTMD in the source level(dso).
    But when I was checking in my dso transformation level the field 0TXTMD was present and mapped.So what colud be the problem as that field was present in dso level but not visible in cubelevel when I was creating transformations.How to go ahead with this issue.
    regards

    Hi Siggi,
    In bw 3.5 i have this scenario.The same i would like to implement in BI 7.0,
    Where is in bw3.5 i have a object called 0txtmd in infosource is assigned to ZDOCTXT element in cube.
    The same as i need to implement in bi 7.0
    while creating the trasnformastion from dso to cube..i could not able to find the field 0txtmd  to map with the field ZDOCTXT in cube.
    Regards

  • Language error while loading master data source for text

    Hi,
    We are getting the following error while loading the data in 0DISTR_CHAN_TEXT data source.
    "Error during multibyte alignment for language D (position 2)".
    Can we filter the data on the Language ( ='EN'). At the data source level LANGU field is marked for selection but still it is not available as filter at info package level.
    Thanks
    VV

    Hey Vishal,
    If the field is marked for Selection at data source level, then it must be available for selection in infopackage.
    Try checking in RSA3 and see if it is available for selection over there. Let us know what was the output in R/3.
    Regards,
    Anjum.

  • Content level setting in OBIEE 11g

    Hi,
    i am new to obiee 11g.i have an doubt in setting up the content level setting in BMM layer.i have given details level in fact LTS content tab with help of physical join,i dont get any error but while trying to generate reports i am getting an error "None of the fact table is compatible with the requested level".where i am commiting mistake,do i need to set content llevel based on physical join or logical join scenario.kindly help regarding this.
    thanks in advance!
    Edited by: Nandha on 10 Jan, 2012 10:55 PM

    Hi Nanda,
    We set the content level of logical source based on the granularity of the source.
    Say, a product hierarchy is like
    Category -> Sub Category -> Product
    Say one of your dimensions has Product information, for this source set the level as 'Product'
    Say there is an aggregated source which has Category information, set the source level as 'Category'.
    Hope this helps you to set your levels.
    Thank you,
    Dhar

  • Ksld not breaking into source file

    Hi guys,
    I installed ksld and started debugging my driver using a tip connection... all works fine.. i inserted a breakpoint on one of my functions in the driver.. and in the tip console once i have reached the breakpoint.. i use ::remote to enter remote mode and start the ksld with all those options on the host and it get connected to the ksld agent.. but the host is not able to show the source code of my driver... ie it always breaks into the asm dump of the driver code.. how do i switch to source display.. but at the same time i am able to edit the source file and all.. ie by using edit command.. but no idea why the asm code is dumped while a break point is reached..
    any idea how we can switch to source level code for debugging..
    thanks all

    The simple answer here is that machine specific files do not need to be checked in. This includes .PSS and .CPD files. The .HHP and .XPJ files are not machine specific, they are project specific and therefore must be checked in. The confusion over the HHP file may come down to whether CHM output is being produced. If you are not, you could safely say that this file need not be source controlled. However it doesn't cost anything to include it under source control so why make life more difficult by excluding it.
      The RoboColum(n)
      @robocolumn
      Colum McAndrew

  • Creator Early Access SDK Level

    Hi
    I downloaded Sun Java Studio Creator 2 Early Access 2. Now I tried to set the source level to 1.5 to support tiger but it always go back to 1.4. Below is how I set the source level to JDK 1.5:
    I select the project and right click to select properties. I select Source from categories (left pane) and select 1.5 from the Source Level drop down in the bottom section of the right pane.
    However, it does not seems to accept that selection and the tool keeps defaulting to Source Level 1.4. And I still get error highlight for 1.5 code syntax support in my Java class.
    Any help to resolve this will be appreciated. Or is it that Sun Java Studio Creator 2 Early Access 2 does not support Source Level 1.5?
    Bisi

    You might want to post that to the Creator 2 EA forum instead of here.
    That forum is at: https://feedbackprograms.sun.com/login.html?ref=%2Fhome%2Ehtml%3F

  • How to disable AutoCommit at DataSource level for 9.2

    Hi,
    I am trying to persist my JMS messages into timesten datastore for which connection received from timesten needs to be with AutoCommit disabled.
    Any idea how to do it in Weblogic 9.2 admin console/JDBC data source level?
    Thanks,
    Alan

    Alan D wrote:
    Hi Joe,
    I am trying to persist jms messages into timesten datastore. This data store is configured for two safe replication which does not allow any operations with autocommit=true. Hence connection which is obtained by this datastore has to be set to autocommit=false before any sql commands.
    I have created persistent store as JDBC store which is mapped to JMS Server. I have tried to use JDBC datasource which supports global transactions as well as datasource which do not support global transaction for this persistent storage. But problem of autocommit still remains.
    Thanks,
    AlanThe restriction that a connection can never operate in autoCommit(true)
    mode is very unusual and against the JDBC spec. You should turn on
    JDBC logging and get us a full stack trace of the driver exception,
    to see where it is being used in the autoCommit(true) mode. By spec
    a driver will deliver a connection in autoCommit(true) mode.
    Joe

Maybe you are looking for

  • Help - I downloaded the latest update for my ipod, but instead it seems to have completely wiped it!

    Can someone please help me - I have downloaded the latest update for my ipod to try to get it to work with iCloud, to back everything up, but instead it seems to have wiped everything and restored my ipod to its factory settings and now when I try to

  • How to get all the columns displayed in pdf.

    If the ALV Display contains 25 columns.When i tried to give the print in PDF format. in the PDF it is displaying only 10 columns.Can you let me know how to display all the columns (i.e 25) in the pdf.

  • Transient VO losing data on refresh

    Hi - I am facing issue in retaining data in Transient VO. I have dropped a Transient VO on jspx as a table and on page load I am calling an AM method and inserting data in the VO. Initially, it works well and I can get the data on the page. But, when

  • Calling Search Help in BAdI implementation.

    Hi All, I have created my search help with search help exit function. Now I need to call this Search Help in my BAdI Implementation ( Method of BAdI) . Please suggest me which function I should use to call my search help.

  • bc4juix:StyledText Links

    We are using the <bc4juix:StyledText> tag to view a viewobject data in a table. We are trying to have the columns represented as links to other JSP pages. Here is a snap shot of the code. <uix:columnHeaderStamp> <uix:styledText textBinding="LABEL"/>