File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes meaningless compilation error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "meaningless compilation error" Watch "meaningless compilation error" New topic
Author

meaningless compilation error

jay thakkar
Greenhorn

Joined: Mar 15, 2013
Posts: 9


y the compilation error occurd???

i m new in java but i follow oracle documentation n i m reading a book on java called "thinking in java"

i m using netbeans 6.9 which i downloaded to learn javaFx language but i can make java applications also... so i guess that must not be n issue n the JDK is 1.7

please please i can't sleep because of this error.. please help
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7492
    
  18

jay thakkar wrote:please please i can't sleep because of this error.. please help

Jay,

1. Welcome to JavaRanch.
2. Please EaseUp (←click).
3. TellTheDetails (←click). What exactly is the error you''re getting?

I can assure you that the error is NOT 'meaningless'. Moreover, it's highly likely that it tells you exactly what the problem is. I suggest you re-read the message carefully, and see if you can work it out for yourself. If you still have problems, come back with the message you got, exactly as it was displayed to you.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4164
    
  21

Also, please read the UseCodeTags page. It makes reading code a lot easier. I added the tags to your post.

The problem you are seeing is that you can't run arbitrary code in side an Class body - you can only do variable declaration and in-line initializations. so this would work because the variable declaration and initialization is on the same line:

If you want the initialization to be separate from the declaration, you can do that but you need to put the initialization into a block - usually a constructor:

But you could also use 'instance initializers' (but these aren't very common, so it can confuse people.):


Steve
jay thakkar
Greenhorn

Joined: Mar 15, 2013
Posts: 9
sorry guys for replying so late.... i m glad that people are so much "helping natured" here so will soon master java technologies

dont know the problem but installed JDK 7.0 and now i m able to run all the programs...

i guess the problem was to me that i just downloaded javaFX 2.1 jdk... so it did not supported basic JAVA syntax.... please correct me if i m wrong.. i will like to learn something new which i dont know
Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

Welcome again Jay.

Jay wrote: please please i can't sleep because of this error.. please help


That sounds more like a 911 call than a java exception / error. Like Winston said, ease up, go step by step and post your doubts here. No need to say please. We will help you. Only condition is you have to show some effort first. If you get stuck, we'll help you out.


dont know the problem but installed JDK 7.0 and now i m able to run all the programs...

i guess the problem was i just downloaded javaFX 2.1 jdk... so it did not supported basic JAVA syntax.... please correct me if i m wrong.. i will like to learn something new which i dont know


It is good that you are not facing any problem after new installation. But make a habit of studying the problem first, why it happened, study the console logs, stack trace, error message etc. Try to find out patterns. It is very important to understand the why part. Don't just jump up if it works. Try to understand why it worked too. Just guessing will not help you.


~ Mansukh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: meaningless compilation error
 
Similar Threads
For that if use the array? Which is the its main function?
can it be valid class declaration [I or [D?
Adding Values in arrays.
Array declaration in a class
Problem with Array.