Results 1 to 10 of 10
  1. #1
    amentjacob1 is offline Member
    Join Date
    Jul 2012
    Posts
    5
    Rep Power
    0

    Default Syntax error on token "}", super expected

    I've seen this error with semi colons before, but what exactly do I do with this?
    Code:Syntax error on token "}", super expected-capture.jpg

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Syntax error on token "}", super expected

    That code doesn't make sense. What are you trying to do just past the red-lined closing brace in the parenthesis?

    I'm talking about the line that begins (EntityFan.class,....
    It just doesn't make sense.

  3. #3
    amentjacob1 is offline Member
    Join Date
    Jul 2012
    Posts
    5
    Rep Power
    0

    Default Re: Syntax error on token "}", super expected

    it was originally the same as the line above the closing brace with the map.put in front, but it gave me an error with that . I got rid of that and now it's fixed. The only error in the code that it is showing is the one that I mentioned above.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Syntax error on token "}", super expected

    Quote Originally Posted by amentjacob1 View Post
    it was originally the same as the line above the closing brace with the map.put in front, but it gave me an error with that . I got rid of that and now it's fixed. The only error in the code that it is showing is the one that I mentioned above.
    Show more of your code, the whole class if it's not too big, please show it as text here wrapped in [code] [/code] tags, and please post the exact error message, the whole thing.

  5. #5
    amentjacob1 is offline Member
    Join Date
    Jul 2012
    Posts
    5
    Rep Power
    0

    Default Re: Syntax error on token "}", super expected

    This is the relevant code for what I'm trying to do
    Java Code:
    		// Adoring Fan
    				//register the entity
    				ModLoader.registerEntityID(EntityFan.class, "Adoring Fan", ModLoader.getUniqueEntityId());
    						
    				ModLoader.addSpawn("Adoring Fan", 100, 1, 50, EnumCreatureType.creature, new BiomeGenBase[] {
    						BiomeGenBase.plains
    				});
    	
    		
    		
    
    	}
    	
    	public void generateSurface(World world, Random random, int chunkX, int chunkZ)
    	{
    		randomGenerator = random;
    		
    		for (int i = 0;  i < 1;  i++)
    		{
    			int randPosX = chunkX + randomGenerator.nextInt(16);
    			int randPosY = random.nextInt(60);
    			int randPosZ = chunkZ + randomGenerator.nextInt(16);
    			(new WorldGenMinable(sapBlock.blockID, 50)).generate(world, random, randPosX, randPosY, randPosZ);
    								 
    		}
    	}
    	
    	
    	public String getVersion()
    	{
    		return "Realms Mod Version 1.0";
    	}
    	
    	public void addRenderer(Map map)
    	{
    		map.put(EntityPenguin.class, new RenderPenguin(new ModelPenguin(), 0.5F));
    	}
    		(EntityFan.class, new RenderFan(new ModelAdoringFan(), 0.5F));
    	}}
    The error said "Syntax error on token "}", super expected" on that one closing brace.
    Last edited by amentjacob1; 07-06-2012 at 04:57 AM.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Syntax error on token "}", super expected

    Again you have code that doesn't make sense, that isn't Java even:

    Java Code:
    public void addRenderer(Map map)
    {
        map.put(EntityPenguin.class, new RenderPenguin(new ModelPenguin(), 0.5F));
    }
    
        // again, what the heck is the code below this comment supposed to be doing?
        (EntityFan.class, new RenderFan(new ModelAdoringFan(), 0.5F));
    }}
    The code that I've indicated above, the code below the comment makes no sense and isn't valid Java. There is no method call, no constructor call, but instead a naked parenthesis with some code in it. I can't make heads or tails of it. And it's not even being called in a method or constructor block.

    Edit: The offending line appear similar to the line above it, as if you were trying to use it as a parenthesis of a map.put(...) method call, but forgot the map.put part, and forgot to call it inside of a method block, but instead have it hanging out naked in your class.

    Again, what are you trying to do with that line? Also, what is the purpose of your project, and how well versed are you in Java programming?
    Last edited by Fubarable; 07-06-2012 at 05:04 AM.

  7. #7
    amentjacob1 is offline Member
    Join Date
    Jul 2012
    Posts
    5
    Rep Power
    0

    Default Re: Syntax error on token "}", super expected

    I am trying to make a mod for Minecraft, I know barely anything about Java, only watched a few tutorials on how to make this stuff which is the other code. What I am trying to do is make it so that that entity renders in the game. (or whatever that does...it wasn't explained very well)

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Syntax error on token "}", super expected

    Quote Originally Posted by amentjacob1 View Post
    I am trying to make a mod for Minecraft, I know barely anything about Java, only watched a few tutorials on how to make this stuff which is the other code. What I am trying to do is make it so that that entity renders in the game. (or whatever that does...it wasn't explained very well)
    You're trying to do some fairly complex Java coding then without knowing basic Java syntax, and that won't work, since you can't just make up code and hope or pray that it will work. I strongly urge you to put aside your project for now go through some basic tutorials if you want to avoid a *lot* of frustration. This is a very good one here: The Java Tutorials: The Really Big Index

  9. #9
    amentjacob1 is offline Member
    Join Date
    Jul 2012
    Posts
    5
    Rep Power
    0

    Default Re: Syntax error on token "}", super expected

    Thanx, I'll get to that tomorrow i think

  10. #10
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Syntax error on token "}", super expected

    Put another way:

    Java Code:
    public void addRenderer(Map map)
    {
        map.put(EntityPenguin.class, new RenderPenguin(new ModelPenguin(), 0.5F));
    }
    the code above is valid Java. You have created a method, addRenderer, and inside of the method, you are calling a method of the map object. Note that this method call is made *inside* of the addRenderer method, a key point.

    This code below however:

    Java Code:
        (EntityFan.class, new RenderFan(new ModelAdoringFan(), 0.5F));
    }}
    is not inside of any method, so it is invalid due to its location. But not only that it looks as if it were beheaded. You have the method parameter but no object (such as map in the valid code above), and no method name (such as put in the method above). So it is senseless.

Similar Threads

  1. Java "Identifier Expected" Error
    By Misho554 in forum New To Java
    Replies: 3
    Last Post: 03-15-2012, 06:09 PM
  2. Syntax error in eclipse for "enum" defination.
    By gunwantw in forum Eclipse
    Replies: 1
    Last Post: 07-08-2010, 10:21 AM
  3. Syntax error on token "(", ; expected
    By baltimore in forum AWT / Swing
    Replies: 3
    Last Post: 10-28-2009, 01:19 AM
  4. Syntax error on token "(", ; expected
    By romilc in forum New To Java
    Replies: 7
    Last Post: 10-24-2009, 02:23 AM
  5. Replies: 3
    Last Post: 12-05-2008, 09:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •