Compilation error with simple if-else statement

package chapterFive;
* Author: Sarab
* Filename: MainClass.java
* Purpose: Try and get my mind around the concept of the selection
* control structures and repetition statements
class MainClass {
     public static void main(String [] args)
          // some variables and prompt for input
          java.util.Scanner scan = new java.util.Scanner(System.in);
          System.out.print("Please enter your name: ");
          String input = scan.nextLine();
          // some repetition statement, for loop
          if (input.equals("Sarab"));
               System.out.println("Welcome Sarab!");
          else
               System.out.println("You are in the else statement");
               for(int sentinelValue; sentinelValue<5; sentinelValue++)
                    System.out.println("The following is the numbers 0-4"
                              + " printed on separate lines: " + sentinelValue);
          System.out.println("This line will print regardless of whether you"
                    + " entered the if or the else portion of the selection"
                    + " statement.");
}I am getting the following error:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
     Syntax error on token "else", delete this token
     at chapterFive.MainClass.main(MainClass.java:26)What's the matter? This looked straight forward enough to me.

if (input.equals("Sarab"));
// is the same as
if (input.equals("Sarab")) {}
// so what you have amounts to this:
if (input.equals("Sarab")) {}
  System.out.println("Welcome Sarab!");
else { ... }You've got an if block that does nothing, then a block that always executes, calling println, and then your else. Since you have that block between if and else, the if has ended and it's not legal to use else.
Get rid of the semicolon after if.

Similar Messages

  • Boolean error with a If else statement

    Hello, i am new to java, and the only other programing language i have used is pascal, and compared to java its ALOT different any ways my problem. I am trying to write a simply little program which random selects a number between 1 and 10, i did that fine got to show that on screen with no probelm . Next i wanted to but in a if else statement, depending which numbers was selected it would show a different message this is where i am getting a probelm, here is the code for the whole thing:
    // randomColour
    import javax.swing.JOptionPane;
    public class randomColour {
      public static void main ( String args [])
        int value;
         value = 1 + ( int ) ( Math.random() * 10 );
            if (value = "1" )
             System.out.println("Green");
               else
                System.out.println("Blue");
              System.exit( 0 );
       } // end mainWhen i try to Compile it comes up with error saying required:boolean why is this? and what can i do to change to fix it?

    A single = is used to indicate assignment. You are testing for equality which requires ==. Also, "1" is a String. Value is an int. Changeif value = "1" to if value == 1Mark

  • "catch is unreachable" compiler error with java try/catch statement

    I'm receiving a compiler error, "catch is unreachable", with the following code. I'm calling a method, SendMail(), which can throw two possible exceptions. I thought that the catch statements executed in order, and the first one that is caught will execute? Is their a change with J2SE 1.5 compiler? I don't want to use a generic Exception, because I want to handle the specific exceptions. Any suggestions how to fix? Thanks
    try {
    SendMail(....);
    } catch (MessagingException e1) {
    logger.fine(e1.toString());
    } catch (AddressException e2) {
    logger.fine(e2.toString());
    public String SendMail(....) throws AddressException,
    MessagingException {....                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I found the problem:
    "A catch block handles exceptions that match its exception type (parameter) and exception types that are subclasses of its exception type (parameter). Only the first catch block that handles a particular exception type will execute, so the most specific exception type should come first. You may get a catch is unreachable syntax error if your catch blocks do not follow this order."
    If I switch the order of the catch exceptions the compiler error goes away.
    thanks

  • Compiler Error with simple vi using MatLab script nodes

    While attempting to build a simple vi to test the capabilities of LabView's interface with MatLab, I received a compiler error message that said I should report the problem to National Instruments Tech Support. The error said, "reference to undefined label from: refPC=0x41C." I've attached the vi that created the error. I am using LabView 7.0 on a PC running Windows 98.
    Attachments:
    Compliererror.vi ‏11 KB

    I don't know if this will help your problem, but there is a fix for some problems with LabVIEW 7.0 and Matlab:
    http://digital.ni.com/public.nsf/websearch/4475BC3CEB062C9586256D750058F14B?OpenDocument
    Good luck,
    -Jim

  • Compilation error with simple ELSIF

    Below is a magic program that determines self worth in monetary exchange based on the first letter that comes to you your mind. Whether it realy does that or not is besides the point, what I don't get is what is wrong with my ELSIF statement?
    -- Majic program that will guess how much you are worth
    ACCEPT s_first PROMPT 'Enter your random letter'
    DECLARE
    random_letter  VARCHAR(20);
    personal_worth   VARCHAR(20);
    BEGIN
    IF random_letter >= 'A' AND <= 'D' THEN
    personal_worth = '$100,000';
    ELSIF random_letter >= 'E' AND <= 'K' THEN
    personal_worth = '$10,000';
    ELSIF random_letter >= 'L' AND <= 'N' THEN
    personal_worth = '$1,000';
    ELSIF random_letter >= 'O' AND <= 'P' THEN
    personal_worth = '$100';
    ELSIF random_letter >= 'Q' AND <= 'T' THEN
    personal_worth = '$10';
    ELSE random_letter >= 'U' AND <= 'Z' THEN
    personal_worth = '$1';
    dbms_output.put_line('The letter you entered was ' || random_letter || ' and your personal worth is ' || personal_worth);
    END;

    Hi,
    The code in Husain's last message works for me.
    When I enter F, it prints $10,000:
    'Enter your random letter'
    F
    The letter you entered was F and your personal worth is $10,000
    PL/SQL procedure successfully completed.When I enter T, it prints $10:
    'Enter your random letter'
    T
    The letter you entered was T and your personal worth is $10
    PL/SQL procedure successfully completed.What are you doing differently?
    Post your exact code and output.
    The code I'm running is:
    set define '&';
    PROMPT 'Enter your random letter'
    ACCEPT random_letter
    declare
         --random_letter VARCHAR(20);
         personal_worth VARCHAR(20);
    BEGIN
          IF    '&random_letter' >= 'A' AND '&random_letter' <= 'D' THEN
                   personal_worth := '$100,000';
          ELSIF '&random_letter' >= 'E' AND '&random_letter' <= 'K' THEN
                   personal_worth := '$10,000';
          ELSIF '&random_letter' >= 'L' AND '&random_letter' <= 'N' THEN
                   personal_worth := '$1,000';
          ELSIF '&random_letter' >= 'O' AND '&random_letter' <= 'P' THEN
                   personal_worth := '$100';
          ELSIF '&random_letter' >= 'Q' AND '&random_letter' <= 'T' THEN
                   personal_worth := '$10';
          ELSE --if random_letter >= 'Q'
                  personal_worth := '$1';
          end if;
    --    dbms_output.put_line('The letter you entered was ' || '&random_letter' || ' and your personal worth is ' || personal_worth);
          dbms_output.put_line('The letter you entered was &random_letter and your personal worth is ' || personal_worth);
    END;
    /Note that I changed the put_line statement at the end, but the two produce the exact same results.
    The commented out version is concatenating 3 string literals, analagous to this:
    'x' || 'y' || 'z'The second version is printing the exact same text as one sting literal:
    'xyz'If you you have a reason for using the longer way, then use it.

  • Compilation errors with JDeveloper 10.1.2.2.0

    Hello,
    I want to change my environment work. First I worked with Eclipse (Europa, jre 1.6), I have no error with my following code source :
    private List<String> lString;
    and now I have a compilation error with the same code
    ' Error(43,14): <identifier> expected '
    I think it's a compiler version problem but I'm not sure and I don't know how to change the compiler version.
    If someone have any idea, I will be happy to receive response.
    Thanks

    JDeveloper 10.1.2.2.0 doesn't support neither JDK 1.6 nor JDK 1.5.
    --olaf                                                                                                                                                                                       

  • Compiler bug in 10.1.3 EA1?  get "Internal compilation error" with EnumSet

    The code sample below generates "Error: Internal compilation error, terminated with a fatal exception" when doing make. It's a very simple example, it creates an EnumSet with one element and dumps it via the "toString()" method.
    If I change the line:
    "EnumSet set = EnumSet.of(Buttons.ONE);"
    To:
    "EnumSet set = EnumSet.allOf(c);"
    It works fine. For some reason the "of" method of "EnumSet" crashes the compiler.
    Any ideas?
    ========================================
    package mypackage;
    import java.util.EnumSet;
    public class EnumDemo
    enum Buttons { ONE, TWO, THREE }
    public EnumDemo()
    public void dump()
              Class c = Buttons.class;
              EnumSet set = EnumSet.of(Buttons.ONE);
              System.out.println(set.toString());
    public static void main(String[] args)
    EnumDemo cls = new EnumDemo();
    cls.dump();
    ==============================

    package com.esp.main;
    import java.awt.Dimension;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import javax.swing.JTree;
    import javax.swing.event.TreeModelEvent;
    import javax.swing.event.TreeModelListener;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreePath;
    public class TreeNavigator extends JTree {
    private FormMain fm;
    public TreeNavigatorNode selectedTreeNode;
    public TreePath selectedTreePath;
    public JTree thisTree;
    public TreeNavigator(FormMain pFM) {
    fm = pFM;
    thisTree = this;
    addTreeSelectionListener(new TreeSelectionListener() {
    public void valueChanged(TreeSelectionEvent e) {
    selectedTreeNode = (TreeNavigatorNode)thisTree.getLastSelectedPathComponent();
    if (selectedTreeNode == null) {
    return;
    selectedTreePath = e.getPath();
    addMouseListener(new MouseAdapter() {
    public void mouseReleased(MouseEvent e) {
    if (e.getClickCount() == 1) {
    doPopup(e.getX(), e.getY());
    String nodeInternalFrameClassName = selectedTreeNode.getInternalFrameClassName();
    String nodeNodeTypeDesc = selectedTreeNode.getNodeTypeDesc();
    if ((selectedTreeNode != null) && (nodeNodeTypeDesc.equals("FORM") || nodeNodeTypeDesc.equals("GRAPH"))) {
    fm.showInternalFrame(nodeInternalFrameClassName, fm, null);
    } else if (e.getClickCount() == 1) {
    TreePath path = thisTree.getClosestPathForLocation(e.getX(), e.getY());
    thisTree.setSelectionPath(path);
    public void doPopup(int x, int y) {
    if ((selectedTreeNode != null) && selectedTreeNode.nodeTypeDesc.equals("MODULE")) {
    fm.cm.sendString("Do Nothing");
    } else {
    fm.cm.sendString("Launch form");
    setEditable(false);
    setMaximumSize(new java.awt.Dimension(3200, 3200));
    setPreferredSize(new java.awt.Dimension(800, 100));
    setShowsRootHandles(false);
    setLargeModel(false);
    setRootVisible(false);
    setDragEnabled(false);
    DefaultTreeModel treeNavigatorModel = new DefaultTreeModel(fm.treeNavigatorNodeArray[fm.rootNode], true);
    treeModel.addTreeModelListener(new NavigatorTreeModelListener());
    setModel(treeNavigatorModel);
    expandAll(this);
    try {
    jbInit();
    } catch (Exception e) {
    e.printStackTrace();
    public void expandAll(JTree tree) {
    int row = 0;
    while (row < tree.getRowCount()) {
    tree.expandRow(row);
    row++;
    private void jbInit() throws Exception {
    this.setSize(new Dimension(286, 383));
    TreeNavigatorCellRenderer renderer = new TreeNavigatorCellRenderer(fm);
    this.setCellRenderer(renderer);
    class NavigatorTreeModelListener implements TreeModelListener {
    public void treeNodesChanged(TreeModelEvent e) {
    TreeNavigatorNode node;
    node = (TreeNavigatorNode)(e.getTreePath().getLastPathComponent());
    * If the event lists children, then the changed
    * node is the child of the node we've already
    * gotten. Otherwise, the changed node and the
    * specified node are the same.
    try {
    int index = e.getChildIndices()[0];
    node = (TreeNavigatorNode)(node.getChildAt(index));
    } catch (NullPointerException exc) {
    public void treeNodesInserted(TreeModelEvent e) {
    public void treeNodesRemoved(TreeModelEvent e) {
    public void treeStructureChanged(TreeModelEvent e) {
    }

  • Error msg in IF ELSE statement in jsp page, Need help

    Below is my code I am trying to execute, but keep getting an error:
    Compilation error occured:
    Found 1 errors in JSP file:
    D:\\http\\proFolder\\student.jsp:130: Syntax: "}" inserted to complete StatementNoShortIf
    <%if (assess.getNumberValue() > 0) {%>
         <%if ((assess.getTotalCost(appForm)) <= (assess.getNumberValue())) {%>
         <strong><%=assess.getTotalCost(appForm)%></strong>      
            <%}%>
    <%}%>
    <%else {%>
         <%=assess.getTotalCost(appForm)%>
    <%}%>Basically, What I am trying to do is follow this logic:
    IF method getNumberValue() is greater then 0, then execute the second IF statement that
    is, If method getTotalCost() is less then or equal to getNumberValue() then display value of method getTotalCost()
    End Second IF
    End First IF
    Now if the First IF fails ( that is getNumberValue() is not gether then 0)
    then execute the else statement
    Could someone please guide me what I am doing wrong, and what would be the correct way of write the IF else code
    Thanks,

    <%     if (assess.getNumberValue() > 0) {
              if ((assess.getTotalCost(appForm)) <= (assess.getNumberValue())) {
    %>
                   <strong><%=assess.getTotalCost(appForm)%></strong>      
    <%          
    %>
    <%
         else {
    %>
              <%=assess.getTotalCost(appForm)%>
    <%
    %>

  • Compile Error with ResultSet.CONCUR_UPDATEABLE

    Hi All,
    I get the following compile error
    "CopyTable.java [49:1] cannot resolve symbol
    symbol : variable CONCUR_UPDATEABLE
    location: interface java.sql.ResultSet
    Statement DestStmt = DestDB.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATEABLE);
    ^
    1 error"
    Is there a simple answer to this?
    RGDS
    Richard

    You must type : CONCUR_UPDATABLE not CONCUR_UPDATEABLE

  • Compilation Error with Solaris8

    Hi ,
    I am getting a queer compilation error when compiling a simple C++ program on
    Solaris8 . The error does not occur with solaris7 . I have inclued the program
    and the error message . Can you give me some tips to overcome this problem .
    #include <iostream.h>
    int main ( void)
         cout << "hello world" ;
    /*************COMPILATION ERRROS ***************/
    "/usr/include/iso/wchar_iso.h", line 100: Error: Multiple declaration for mbstate_t.
    "/opt/SUNWspro/SC5.0/include/CC/./iosfwd", line 51: Error: The name mbstate_t is ambiguous, std::mbstate_t and std::mbstate_t.
    "/opt/SUNWspro/SC5.0/include/CC/./iosfwd", line 78: Error: The name mbstate_t is ambiguous, std::mbstate_t and std::mbstate_t.
    "/opt/SUNWspro/SC5.0/include/CC/rw/iotraits", line 56: Error: The name mbstate_t is ambiguous, std::mbstate_t and std::mbstate_t.
    4 Error(s) detected.
    Regards,
    vichu

    Thanks! However, my sample code does not inclide iostream.
    #include <string>
    main() {
    string s = "123asd";
    exit(0);
    and there is the output
    hwang@jazz: /opt/SUNWspro/SC5.0/bin/CC test.C
    "/usr/include/wchar_impl.h", line 24: Error: Multiple declaration for __mbstate_t.
    "/usr/include/wchar.h", line 90: Error: Multiple declaration for mbstate_t.
    "/opt/SUNWspro/SC5.0/include/CC/./iosfwd", line 37: Error: The name __mbstate_t is ambiguous,
    __mbstate_t and __mbstate_t.
    "/opt/SUNWspro/SC5.0/include/CC/./iosfwd", line 45: Error: Multiple declaration for mbstate_t.
    "/opt/SUNWspro/SC5.0/include/CC/rw/iotraits", line 37: Error: The name __mbstate_t is ambiguou
    s, __mbstate_t and __mbstate_t.
    "/opt/SUNWspro/SC5.0/include/CC/rw/iotraits", line 57: Error: Multiple declaration for mbstate
    _t.
    "test.C", line 4: Error: string is not defined.
    "test.C", line 4: Error: Cannot use const char* to initialize int.
    8 Error(s) detected.
    Any ideas?
    Thanks again

  • BUG: 10.1.3..36.73 Internal Compile Error with enhanced for loop/generics

    I get the following compiler error when using the Java 5 SE enhanced for loop with a generic collection.
    Code:
    public static void main(String[] args)
    List<Integer> l = new ArrayList<Integer>();
    l.add(new Integer(1));
    printCollection(l);
    private static void printCollection(Collection<?> c)
    for (Object e : c)
    System.out.println(e);
    Error on attempting to build:
    "Error: Internal compilation error, terminated with a fatal exception"
    And the following from ojcInternalError.log:
    java.lang.NullPointerException
         at oracle.ojc.compiler.EnhancedForStatement.resolveAndCheck(Statement.java:2204)
         at oracle.ojc.compiler.StatementList.resolveAndCheck(Statement.java:4476)
         at oracle.ojc.compiler.MethodSymbol.resolveMethod(Symbol.java:10822)
         at oracle.ojc.compiler.RawClassSymbol.resolveMethodBodies(Symbol.java:6648)
         at oracle.ojc.compiler.Parser.resolveMethodBodies(Parser.java:8316)
         at oracle.ojc.compiler.Parser.parse(Parser.java:7823)
         at oracle.ojc.compiler.Compiler.main_internal(Compiler.java:978)
         at oracle.ojc.compiler.Compiler.main(Compiler.java:745)
         at oracle.jdeveloper.compiler.Ojc.translate(Ojc.java:1486)
         at oracle.jdeveloper.compiler.UnifiedBuildSystem$CompileThread.buildGraph(UnifiedBuildSystem.java:300)
         at oracle.jdeveloper.compiler.UnifiedBuildSystem$CompileThread.buildProjectFiles(UnifiedBuildSystem.java:515)
         at oracle.jdeveloper.compiler.UnifiedBuildSystem$CompileThread.buildAll(UnifiedBuildSystem.java:715)
         at oracle.jdeveloper.compiler.UnifiedBuildSystem$CompileThread.run(UnifiedBuildSystem.java:893)

    Install the Service Update 1 patch for JDeveloper (using the help->check for updates), and let us know if this didn't solve the problem.

  • Compilation errors with store procedure

    Hi guys, I just started SQL so forgive me if I ask any real stupid questions. This is the problem I have right now as said in my title.
    This is my procedure.sql
    CREATE OR REPLACE PROCEDURE verify IS
    no_of_duplicates NUMBER:=0;
    BEGIN
    SELECT COUNT(*) INTO no_of_duplicates
    FROM EMPLOYEE
    WHERE E# =
    (sELECT E# FROM DRIVER
    WHERE EXISTS
    (SELECT E# FROM MECHANIC
    WHERE DRIVER.L# = MECHANIC.L#));
    IF no_of_duplicates:=0 THEN dbms_output.put_line('OK');
    ELSE
    SELECT E#,NAME FROM EMPLOYEE
    WHERE E# =
    (SELECT E# FROM DRIVER
    WHERE EXISTS
    (SELECT E# FROM MECHANIC
    WHERE DRIVER.L# = MECHANIC.L#));
    END IF;
    END verify;
    While trying to create the procedure, it gives me the compilation errors. I have been stuck with this for hours and can't seem to find anything wrong with it. Can anyone point me in the right direction? Thanks!

    Hi,
    Once again, post your code.  The error occurs when you call the procedure, but you haven't posted the code that calls the procedure and causes the error.
    When I do this in SQL*Plus:
    SET  SERVEROUTPUT  ON  FORMAT WRAPPED
    EXEC  verify;
    The procedure you posted runs perfectly (that is, is displays the e# only, exactly as it was designed to do).
    One way to display both the e# and the name is to BULK COLLECT both the e# and name into separate collections, like this:
    CREATE OR REPLACE PROCEDURE verify IS 
        TYPE  e#_table  IS TABLE OF employee.e#%TYPE;
        e#_list    e#_table;
        TYPE  name_table  IS TABLE OF employee.name%TYPE;
        name_list  name_table;
    BEGIN 
        SELECT            e#,       name
        BULK COLLECT INTO e#_list,  name_list
        FROM              employee 
        WHERE   e# IN (
                          SELECT  d.e#
                          FROM    driver    d
                          JOIN    mechanic  m  ON  d.e#  = m.e# 
        IF  e#_list.COUNT  = 0
        THEN
            dbms_output.put_line ('OK, there are no illict duplications');
        ELSE     -- that is, e#_list.COUNT <> 0
            dbms_output.put_line ('The following employees are both drivers and mechanics:');
            FOR j IN 1..e#_list.COUNT LOOP    -- i in parentheses sometimes displays wrong on the OTN site
                dbms_output.put      ( TO_CHAR ( e#_list (j)
                                               , '999999999999'
                dbms_output.put      ('   ');
                dbms_output.put_line (name_list (j)); 
            END LOOP; 
        END IF; 
    END verify; 
    SHOW ERRORS
    Here's the output I get when I run the procedure above with your sample data:
    The following employees are both drivers and mechanics:
                1   John Smith
    You'll notice I made several other changes in your code, sometimes because they are clearly better practices, and sometimes just to show you different ways to do the same thing, which you may or may not want to use in this problem.
    For example, you were doing the same query (with only very slight differences) 2 times: once to get no_of_duplicates, and then a second time to get the actual data.  I don't know if that's the most efficient way to do what you need.  Say there are 1000 rows in the result set.  You'll fetch all 1000 once just to get the total number, (which you don't need, if all you care about at this point is if there are any), and then to get the data.  When you do a BULK COLLECT, you automatically get the COUNT anyway, so why not do the BULK COLLECT first, then use that COUNT to see what you have to do next.  If the COUNT is more than 0, then you've already got the data, and you don't need to fetch it again.  Also, repeating (essentially) the same code is a maintenance problem.  If you ever need to make a change, you need to make the same change in multiple places.  At best, that's a pain; but this is the exactly the kind of mistake that is easy to miss in in testing, and you might have code running for weeks in Production before you notice that sometimes it's giving the wrong results.
    Another example: e# is a NUMBER.  While it is possible to convert NUMBERs into VARCHAR2s, and then store those VARCHAR2s in a VARCHAR2 collecction, wouldn't it make more sense just to store them in a NUMBER collection?

  • [ SOLVED ] Compile Error with Java Fonts & IntelliJ

    Hi All
    I have now got a new problem when i compile a flex project.  Yesterday inorder to get the IJ Interface font smoothing sorted, i had to add this line to my ~/.bashrc file
    _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on
    But now when i go to run a flex project, i get the following error message
    Information:Using built-in compiler shell, up to 4 parallel threads
    See compiler settings at File | Settings | Compiler | Flex Compiler page
    Information:Starting Flex compiler:
    /opt/java/jre/bin/java -Dapplication.home=/home/julian/SDK/flex_sdk_4.5.0.17855 -Xmx384m -Dsun.io.useCanonCaches=false -Duser.language=en -Duser.region=en -Xmx1024m -classpath /opt/idea-IU-98.311/plugins/flex/lib/flex-compiler.jar:/home/julian/SDK/flex_sdk_4.5.0.17855/lib/flex-compiler-oem.jar com.intellij.flex.compiler.FlexCompiler 48936
    Information:Compilation completed with 2 errors and 0 warnings
    Information:2 errors
    Information:0 warnings
    Error:Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on
    Error:java.net.SocketException: Socket closed
    Error:java.net.ConnectException: Connection refused
    Error:     at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:529)
         at java.net.Socket.connect(Socket.java:478)
         at java.net.Socket.<init>(Socket.java:375)
         at java.net.Socket.<init>(Socket.java:218)
         at com.intellij.flex.compiler.FlexCompiler.openSocket(FlexCompiler.java:35)
         at com.intellij.flex.compiler.FlexCompiler.main(FlexCompiler.java:70)
    Any suggestions, besides disabling the _JAVA_OPTION again ?
    Many Thanks
    Last edited by whitetimer (2010-11-14 17:24:11)

    -Dawt.useSystemAAFontSettings=on needs to be added to the end of file
    idea.vmoptions

  • Compilation errors with boost 1.36

    Hi,
    My compiler
    CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-08 2002/06/02
    I am getting the followin*g errors when trying to compile
    Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    "./boost/math/tools/precision.hpp", line 108: Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    "./boost/math/tools/precision.hpp", line 116: Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    "./boost/math/tools/precision.hpp", line 122: Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    "./boost/math/tools/precision.hpp", line 128: Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    "./boost/math/tools/precision.hpp", line 141: Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    "./boost/math/tools/precision.hpp", line 172: Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    I have done configuration as following
    %> ./configure with-toolset=sun prefix=/u/jn/boost/boost_1_36_0
    my usr-config.jam file looks as below
    # Boost.Build Configuration
    # Automatically generated by Boost configure
    # Compiler configuration
    using sun : 6 : /home/nfs/sollocal/beatlehome1/F6U2/SUNWspro/bin/CC : <stdlib>sun-stlport
    <cxxflags>-library=stlport4 -m64 -xcode=pic32 -erroff=wvarhidemem,hidevf,hidevfinvb -errtag
    s=yes <linkflags>-library=stlport4 -m64 ;
    # Python configuration
    using python : 2.6 : /usr/local ;
    my Makefile
    BJAM=./tools/jam/src/bin.solaris/bjam
    BJAM_CONFIG= -sICU_PATH=/usr
    prefix=/u/jnarayan/boost/boost_1_36_0
    exec_prefix=$(prefix)
    libdir=$(exec_prefix)/lib
    includedir=$(prefix)/include
    LIBS=
    all: .dummy
    @echo "$(BJAM) $(BJAM_CONFIG) --user-config=user-config.jam $(LIBS)"
    @$(BJAM) $(BJAM_CONFIG) --user-config=user-config.jam $(LIBS) || \
    echo "Not all Boost libraries built properly."
    clean: .dummy
    rm -rf bin.v2
    distclean: clean
    rm -rf Makefile config.log
    check: .dummy
    @cd status && ../$(BJAM) $(BJAM_CONFIG) --user-config=../user-config.jam || echo "S
    ome Boost regression tests failed. This is normal for many compilers."
    install: .dummy
    @echo "$(BJAM) $(BJAM_CONFIG) address-model=64 user-config=user-config.jam pref
    ix=$(prefix) exec-prefix=$(exec_prefix) libdir=$(libdir) --includedir=$(includedir) $(L
    IBS) install"
    @$(BJAM) $(BJAM_CONFIG) address-model=64 --user-config=user-config.jam --prefix=$(p
    refix) --exec-prefix=$(exec_prefix) --libdir=$(libdir) --includedir=$(includedir) $(LIBS) i
    nstall || echo "Not all Boost libraries built properly."
    .dummy:
    thanks in advance for your help

    BOOST cannot be compiled with WS6u2.
    The oldest compiler that can build BOOST is Sun Studio 11 (C++ 5.8).
    You will have better luck with Sun Studio 12 (C++ 5.9). Both Studio 11 and Studio 12 are free.
    Get Sun Studio 12 here:
    [http://developers.sun.com/sunstudio/]
    Sun Studio 12 requires Solaris 9, 10, or Open Solaris.
    If you are running Solaris 8, get Sun Studio 11 instead:
    [http://developers.sun.com/sunstudio/products/previous/11/index.jsp]
    After installing the appropriate version of Sun Studio, get all current patches for it here:
    [http://developers.sun.com/sunstudio/downloads/patches/index.jsp]
    Then check Simon's blog for advice on building BOOST with Sun Studio 11 or 12.
    [http://blogs.sun.com/sga/category/Boost]

  • Compilation error with (amp) restriction specifier in C++ AMP

    Hi,
    [double post from :
    original post ]
    I'm using C++ AMP (I'm not that experienced with C++ and I'm new to AMP, so I have to stumble through this stuff) But I thought I had this code working, but now I'm getting the following error:
    Error    1    error C3930: 'WRC_Raytracer::RaytracerRTC::RenderSceneWithAMP::<lambda_c13eb21eb34534d03d408733745bcf16>::operator ()' : no overloaded function has restriction specifiers that are compatible with the ambient
    context 'Concurrency::_Parallel_for_impl'
    Here is my parallel loop (cut down slightly to focus on the issue):
    [code]
        parallel_for(0, 720 * 576, 1, [w, cBuffer, pixelDataView](int i) restrict(amp)
                    // compute x and y for the given index
                    float x = (float)(i % w);
                    float y = (float)(i / w);
                    // convert color from {0,1}f to {0,255}b
                    int bInt, gInt, rInt;
                    bInt = (int) (min(x/719.f, 1) * 255);
                    gInt = (int) (min(y/575.f, 1) * 255);
                    rInt = (int) (min(0, 1) * 255);
                    // represent color data as (int)argb
                    int pixelAsInt = (255 << 24) + (rInt << 16) + (gInt << 8) + bInt;
                    // update pixelData element
                    pixelDataView[i] = pixelAsInt;
    [/code]              
    Can anyone see what's wrong here ? As I said, I'm sure this was working yesterday, and I did something just before shutting down, and now it's not working.
    Edit : I tried the parallel_for_each loop that I had started with. And that actually does work ...
    parallel_for_each(pixelDataView.extent,[=](index<1> idx) restrict(amp)

    Hello Gavin, thank you for your question.
    Note that parallel_for_each (more precisely, the overloads that accept extent arguments and take a restrict(amp) functional parameter) is the unique entry-point for C++ AMP execution. Other functions in the concurrency namespace, such as parallel_for,
    are unrelated, and stem from a different technology (PPL). Since restrict(amp) is specific to C++ AMP, trying to use a restrict(amp) functional object in any context but that of C++ AMP execution, is not possible - hence the compiler error
    you were seeing. Hopefully this turns out helpful for you. Also, congratulations for picking up C++ AMP, I hope you like it! Cheers!

Maybe you are looking for