This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can Not Compile - Help!

 
G. Graz
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following code that is for a insertionsort, problem is I think my code looks good but I can not get it to compile? I do not see what I am missing ? Any ideas what I am missing ? Thank you everyone for all the help.

 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12022
25
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you mean by 'not compile'? what, EXACTLY, is the error message? The easier you make it for us, the more likely someone can help you.
 
G. Graz
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry , Running my code with out errors ? I use textpad and I am getting this message:

array required, but E found
for(s = i; s > 0 && t.compareTo(t[s - 1]) < 0; s--)



Ok, sorry I thought "Compile" was a common term ?

Greg
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And when you get that message, the ^ is pointing to t[s - 1]...

So what exactly is t[s - 1]? Focus on that, and you will see that the error message is telling you exactly what the problem is.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Greg Grazioli:
Ok, sorry I thought "Compile" was a common term ?

Ofcourse it is, but Fred means: tell us exactly what the error message is that the compiler gives you (copy and paste it from the command prompt, for example) - if you only say "it doesn't work", then it's much more work for anyone who's reading your question to find out what might be wrong. In other words, tell the details.
 
Rob Spoor
Sheriff
Pie
Posts: 20388
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marc is right - you're mixing up two variables.
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12022
25
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when you said 'can't compile', that could mean:

Your OS can't find the javac.exe
Your OS can't find various classes
Your OS can't find your .java class
the compiler returns an error

and probably a few other things. Each of these things requires a different path to diagnose and fix. And if it is the last one, the error message give TREMENDOUS amounts of details on what the problem is, and WHERE it is. Posting that (since you already have it) saves anyone who wants to help you the trouble of copying your code into their editor, saving it, then compiling it yourself.

If you had posted that error message in your original post, it could have saved lots of time for the folks helping you.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic