Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6120739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:42:11+00:00 2026-05-23T15:42:11+00:00

I am currently trying to figure out how to use Eclipse to program Escape

  • 0

I am currently trying to figure out how to use Eclipse to program Escape models in java. I am quite new to Escape and Eclipse, and it has been a while since I programmed in java, so please excuse if this is a stupid question.

Basically, I have been haunted by strange Eclipse error messages. I tracked the last one down to this problem:

This works:

public class CoordinationGame extends Scape {

.
    .
    .
    Scape lattice;

boolean test;
int test2;

{
test = true;
test2 = 3;
}

{
lattice = new Scape(new Array2DVonNeumann());
}

}

This gives strange error messages:

public class CoordinationGame extends Scape {

    .
.
.

Scape lattice;

boolean test;
int test2;

test = true;
test2 = 3;

lattice = new Scape(new Array2DVonNeumann());
}

i.e. { expected afer int test2 and Syntax error on token "lattice", VariableDeclaratorId expected after this token.

As I said, Java has been some time, but IIRC, those brackets should not be required. This question establishes that this bracket usage is an initializing block, but this is probably not what I want to do here.

Does anyone know why Eclipse requires me to set these brackets, or what I could do to change this behaviour?

Thanks in advance!
Martin

PS: Some information that will probably be useful:

I use eclipse-indigo, installed the modelling toolkit AMP. I am not entirely sure how to check this, but I believe I am using jre6, as this is what it says in the JRE System Library tab of my package explorer. In the future, I plan to find a way to run the Escape modelling environment with Groovy, but that will be another question …

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:42:11+00:00Added an answer on May 23, 2026 at 3:42 pm

    This has nothing to do with your IDE. Java does not allow statements at class level, it does however allow initializers at class level.

    {foo();}
    

    This is an instance initializer, it will be copied into all constructors by the compiler.
    (See Java Tutorial > Initializing Fields)

    In Java, you can write statements in

    • a method
    • a constructor (which is a special kind of method)
    • an initializer block (static or instance)

    but nowhere else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out how to do this with Eclipse. We currently run
I'm currently trying to figure out when to use ViewModels and when not to.
I am currently writing an IRC client and I've been trying to figure out
I'm currently trying to figure out how to use OpenGL. I want to create
I'm trying to figure out what to use for my web application. Im currently
I'm trying to figure out how to use Zend_Db_Table_Abstract correctly. I want to return
I'm currently beating my head against a wall trying to figure this out. But
I'm trying to figure out how to detect when the current user has changed
I'm currently trying out db4o (the java version) and I pretty much like what
I'm currently trying to figure out how to perform manual windows authentication in our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.