Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java compiler errors

Reply
Thread Tools

Java compiler errors

 
 
RedGrittyBrick
Guest
Posts: n/a
 
      10-07-2008

Jozza wrote:
>
> "Jan Thomä" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>
>> On 2008-10-07 12:22:39 +0200, "Jozza" <(E-Mail Removed)> said:
>>>> Note that if your code is likely to throw an exception and you
>>>> didn't put it with the try/catch to handle the exception,
>>>> there's no way you will be allowed to successfully compile or
>>>> run that code.
>>>>
>>>> If I may ask, why would you want to avoid adding the try/catch
>>>> when you know it's needed?
>>>>
>>> It comes to that when i want to fast write/copy some code to try
>>> something out and i lose time with securing every statement. Its
>>> very annoying and i'm not used to that at any other language, so
>>> i want to turn this part of java compiler's brain off, at least
>>> when i want to. You know ...

>>
>> or better. get some decent java editor which quickly produces
>> try/catch statements for you. About possibly uninitalized
>> variables, you will have to fix this up, there is no way to
>> suppress this check.

>
> Ok then, I guess i will have to comply to the terms of Java compiler.
> LOL )
>


I press Alt+1 for "Quick Fix" in Eclipse. It will then offer to do the
necessary coding for you.
- add try-catch around code that can throw an exception
- add unimplemented methods
(when extending abstract class or implementing interface etc)

Other keyboard short-cuts I use a lot include ...
Ctrl+Space for "Content Assist"
- completes names of variable, class or method.
- suggests parameters for method calls.
Ctrl+Shift+O for "Organize Imports" (
- adds any needed import statements.
Ctrl+Shift+F to reformat (indent) my code.

See http://eclipse-tools.sourceforge.net...cuts_(3.0).pdf

In Eclipse:
Ctrl+Shift+L
Help, Tips&Tricks, Java Development




--
RGB
 
Reply With Quote
 
 
 
 
Patricia Shanahan
Guest
Posts: n/a
 
      10-07-2008
RedGrittyBrick wrote:
>
> Jozza wrote:
>>
>> "Jan Thomä" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>
>>> On 2008-10-07 12:22:39 +0200, "Jozza" <(E-Mail Removed)> said:
>>>>> Note that if your code is likely to throw an exception and you
>>>>> didn't put it with the try/catch to handle the exception,
>>>>> there's no way you will be allowed to successfully compile or
>>>>> run that code.
>>>>>
>>>>> If I may ask, why would you want to avoid adding the try/catch
>>>>> when you know it's needed?
>>>>>
>>>> It comes to that when i want to fast write/copy some code to try
>>>> something out and i lose time with securing every statement. Its
>>>> very annoying and i'm not used to that at any other language, so
>>>> i want to turn this part of java compiler's brain off, at least
>>>> when i want to. You know ...
>>>
>>> or better. get some decent java editor which quickly produces
>>> try/catch statements for you. About possibly uninitalized
>>> variables, you will have to fix this up, there is no way to
>>> suppress this check.

>>
>> Ok then, I guess i will have to comply to the terms of Java compiler.
>> LOL )
>>

>
> I press Alt+1 for "Quick Fix" in Eclipse. It will then offer to do the
> necessary coding for you.
> - add try-catch around code that can throw an exception

....
It also offers the alternative of adding a throws clause to the method
declaration, passing the exception back to the caller. In quick hack
code, that is often a better choice than catching it locally.

Patricia
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      10-08-2008
On Tue, 7 Oct 2008 12:07:49 +0200, "Jozza" <(E-Mail Removed)> wrote, quoted
or indirectly quoted someone who said :

>Hey all,
>
>I don't know if this is the right group, but heres my problem with java
>compiler.
>
>I'm using eclipse ide and i get this wierd errors if i dont include
>statements in try...catch or if the compiler figures out that some variable
>might not have been initialized. I need to turn this checking off! I dont
>want to be treated like a fool by the compiler.
>I checked all the settings in eclipse but cant find anything appropriate.
>
>Help?
>
>TIA, Jozza
>

see http://mindprod.com/jgloss/compileerrormessages.html
for what the errors mean, at least the Javac ones.
--
Roedy Green Canadian Mind Products
http://mindprod.com/politics/harper.html
Anyone but Harper for Prime Minister of Canada
 
Reply With Quote
 
Jozza
Guest
Posts: n/a
 
      10-08-2008
Yes, this seems like the bast/fastest solution

Thx

"Jan Thom" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
>
> On 2008-10-07 12:22:39 +0200, "Jozza" <(E-Mail Removed)> said:
>>> Note that if your code is likely to throw an exception and you didn't
>>> put it with the try/catch to handle the exception, there's no way you
>>> will be allowed to successfully compile or run that code.
>>>
>>> If I may ask, why would you want to avoid adding the try/catch when
>>> you know it's needed?
>>> Hmm, smells like a ...

>
>> It comes to that when i want to fast write/copy some code to try
>> something
>> out and i lose time with securing every statement.
>> Its very annoying and i'm not used to that at any other language, so i
>> want
>> to turn this part of java compiler's brain off, at least when i want to.
>> You
>> know ...

>
>
> The Java language specification enforces that checked exceptions are
> either to be thrown or catched. There is no way to disable this, it is
> part of the Java language. There are basically two ways to get a quick
> hack:
>
> public void myMethod() throws Exception {
>
> whatever code you write here needs no try/catch
> }
>
> or better. get some decent java editor which quickly produces try/catch
> statements for you. About possibly uninitalized variables, you will have
> to fix this up, there is no way to suppress this check.
>
>
> Jan
>
>
>



 
Reply With Quote
 
Jozza
Guest
Posts: n/a
 
      10-08-2008

"Jozza" <(E-Mail Removed)> wrote in message news:gchn4i$r3v$(E-Mail Removed)...
> Yes, this seems like the bast/fastest solution
>
> Thx
>
> "Jan Thom" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>
>>
>> On 2008-10-07 12:22:39 +0200, "Jozza" <(E-Mail Removed)> said:
>>>> Note that if your code is likely to throw an exception and you didn't
>>>> put it with the try/catch to handle the exception, there's no way you
>>>> will be allowed to successfully compile or run that code.
>>>>
>>>> If I may ask, why would you want to avoid adding the try/catch when
>>>> you know it's needed?
>>>> Hmm, smells like a ...

>>
>>> It comes to that when i want to fast write/copy some code to try
>>> something
>>> out and i lose time with securing every statement.
>>> Its very annoying and i'm not used to that at any other language, so i
>>> want
>>> to turn this part of java compiler's brain off, at least when i want to.
>>> You
>>> know ...

>>
>>
>> The Java language specification enforces that checked exceptions are
>> either to be thrown or catched. There is no way to disable this, it is
>> part of the Java language. There are basically two ways to get a quick
>> hack:
>>
>> public void myMethod() throws Exception {
>>
>> whatever code you write here needs no try/catch
>> }
>>
>> or better. get some decent java editor which quickly produces try/catch
>> statements for you. About possibly uninitalized variables, you will
>> have to fix this up, there is no way to suppress this check.
>>
>>
>> Jan
>>
>>
>>

>
>

Oopss,

Me top-posting again, really sorry




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
java compiler errors on regexs kramer31 Java 4 07-10-2008 11:31 PM
Compiler Error Message: The compiler failed with error code -1073741819 Ram ASP .Net 0 09-13-2005 09:52 AM
Can we use <compiler> tag to avoid RunTime Compiler error? Jack Wright ASP .Net 5 01-19-2004 04:36 PM
Errors, errors, errors Mark Goldin ASP .Net 2 01-17-2004 08:05 PM
Compiler Error Message: The compiler failed with error code 128. Yan ASP .Net 0 07-21-2003 10:49 PM



Advertisments