This discussion is archived
1 2 Previous Next 15 Replies Latest reply: Oct 8, 2009 11:23 PM by 807580 RSS

java program Compiling using Maven

807580 Newbie
Currently Being Moderated
Hi,

I am upgrading 1.4 to 1.5 java. And in my local pc i have compiled programs and able to eploy the application. But the problem is in server when i try to compile using maven it gives a compilation error.

If you are saying that it is an issue of maven then also i wanted to discuss this strange issue here.
 /usr/build/Application/java/com/sql/DataStoreInterface.java:686: warning: unmappable character for encoding UTF8
    [javac] �* Inserts a blank row at the specified position of the DataStore's result set buffer. Returns the number of the row added.
The statement is commented but the compiler is not identified the same. When i checked encoding type using file --mime {filename} i got it like text/x-java; charset=iso-8859-1. This is not the case for all some java file types are text/x-c++; charset=us-ascii but that is not giving error.

One more issue is elicited below.
] cast to java.lang.Object for a varargs call
    [javac] cast to java.lang.Object[] for a non-varargs call and to suppress this warning
    [javac]                     meth.invoke(comp, n);
    [javac]                                       ^
Can any one suggest how can i solve this two issues.

Thanks
Rasa.
  • 1. Re: java program Compiling using Maven
    dcminter Newbie
    Currently Being Moderated
    Remove the errant characters. Since they're in a comment that shouldn't cause any problems.

    The second one is a warning not an error. Put in the cast suggested by the compiler if you want to avoid the warning (unless it's actually incorrect, but that's impossible to say without seeing the code and knowing what you intended it to do).
  • 2. Re: java program Compiling using Maven
    807580 Newbie
    Currently Being Moderated
    dcminter wrote:
    Remove the errant characters. Since they're in a comment that shouldn't cause any problems.
    How can i remove those comments. Comments are showing that the purpose of the methods author etc.
    The second one is a warning not an error.
    Yes it is warnings but looks ugly.
    Put in the cast suggested by the compiler if you want to avoid the warning
    how i can avoid it.
  • 3. Re: java program Compiling using Maven
    gimbal2 Guru
    Currently Being Moderated
    rasa wrote:
    dcminter wrote:
    Remove the errant characters. Since they're in a comment that shouldn't cause any problems.
    How can i remove those comments. Comments are showing that the purpose of the methods author etc.
    You do not remove the comment, you remove the faulty characters from the comment.
    The second one is a warning not an error.
    Yes it is warnings but looks ugly.
    Put in the cast suggested by the compiler if you want to avoid the warning
    how i can avoid it.
    By doing as the compiler AND dcminter suggests and putting in the typecast. If you don't know what that is, at least perform some research.
  • 4. �: java program Compiling using Maven
    782681 Newbie
    Currently Being Moderated
    rasa wrote:
    Hi,

    I am upgrading 1.4 to 1.5 java. And in my local pc i have compiled programs and able to eploy the application. But the problem is in server when i try to compile using maven it gives a compilation error.

    If you are saying that it is an issue of maven then also i wanted to discuss this strange issue here.
    /usr/build/Application/java/com/sql/DataStoreInterface.java:686: warning: unmappable character for encoding UTF8
    [javac] � ...
    � above might be a broken copyright #) symbol. In java code comments, I'd replace it with word *(copyright)*

    --------------

    #) broken copyright symbol -- I've seen it broken that way in one project. I remembered this because one of colleagues made a funny remark on it. There was something like:
    ...it's not a bug, these are sacral signs with a very special meaning.
    Let me explain:
    - i with two dots means we spotted all i's and some more
    - reverted question sign means there are no questions left anymore
    - "1/2" is a math symbol for square root meaning we've got to the roots of the Universe with our product
  • 5. Re: java program Compiling using Maven
    807580 Newbie
    Currently Being Moderated
    >
    You do not remove the comment, you remove the faulty characters from the comment.
    I am not understanding what is this faulty characters
    see in that line i have given my comments in the following format /** Developer Comments **/ . Here which one is faulty.
    By doing as the compiler AND dcminter suggests and putting in the typecast. If you don't know what that is, at least perform some research.
    Yea sure i am ready to do that. But if you know it then you can share it over here. I mean a knowledge share.

    Regards
    Rasa
  • 6. Re: �: java program Compiling using Maven
    807580 Newbie
    Currently Being Moderated
    >
    � above might be a broken copyright #) symbol. In java code comments, I'd replace it with word *(copyright)*
    It is happening with 1.5 version only
    #) broken copyright symbol -- I've seen it broken that way in one project. I remembered this because one of colleagues made a funny remark on it. There was something like:
    ...it's not a bug, these are sacral signs with a very special meaning.
    Let me explain:
    - i with two dots means we spotted all i's and some more
    - reverted question sign means there are no questions left anymore
    - "1/2" is a math symbol for square root meaning we've got to the roots of the Universe with our product
    Tough joke. Sorry not in a mood to laugh :-(
  • 7. Re: java program Compiling using Maven
    gimbal2 Guru
    Currently Being Moderated
    Yea sure i am ready to do that. But if you know it then you can share it over here. I mean a knowledge share.
    I'm not going to teach you Java, sorry. Inheritance and polymorphism are the root of the language (or object oriented programming in general actually) and if you don't know enough about that, it will require a lot more study to get to grips with these terms. Typecasting is only a small part of it all, you need the bigger picture before you can understand it.
  • 8. Re: java program Compiling using Maven
    807580 Newbie
    Currently Being Moderated
    rasa wrote:
    How can i remove those comments. Comments are showing that the purpose of the methods author etc.
    Edit DataStoreInterface.java
    delete line 686.
    Then add a new line in its place:
     * Inserts a blank row at the specified position of the DataStore's result set buffer. Returns the number of the row added.
    Do not copy and paste the original line.
  • 9. Re: java program Compiling using Maven
    807580 Newbie
    Currently Being Moderated
    Just because its a warning doesn't mean your intent in code is not correct. Its just giving you some advice. If the code does what you want, you can suppress the warning by putting something like this above the function's declaration:
    @SuppressWarnings("deprecation"). However, you will have to research 'supresswarnings' on google to see what the correct term to use instead of 'deprecation. However, I suggest trying to solve as many warnings that you can if possible before using suppressWarnings.
  • 10. Re: java program Compiling using Maven
    807580 Newbie
    Currently Being Moderated
    njb7ty wrote:
    Just because its a warning doesn't mean your intent in code is not correct. Its just giving you some advice. If the code does what you want, you can suppress the warning by putting something like this above the function's declaration:
    @SuppressWarnings("deprecation"). However, you will have to research 'supresswarnings' on google to see what the correct term to use instead of 'deprecation'.
    There is no way to suppress
    warning: unmappable character for encoding UTF8
    For a list of what you can suppress
    C:> javac -X
    ...
      -Xlint:{all,deprecation,unchecked,fallthrough,path,serial,finally,-deprecation,-unchecked,-fallthrough,-path,-serial,-finally} Enable or disable specific warnings
    ...
  • 11. Re: �: java program Compiling using Maven
    782681 Newbie
    Currently Being Moderated
    rasa wrote:
    >
    � above might be a broken copyright #) symbol. In java code comments, I'd replace it with word *(copyright)*
    It is happening with 1.5 version only
    did you try it with 1.4 version on the same machine, with the same locale settings? I ask because googling for "unmappable character �" shows that stuff like that is often related to different locale settings
  • 12. Re: �: java program Compiling using Maven
    807580 Newbie
    Currently Being Moderated
    gnat wrote:
    rasa wrote:
    >
    � above might be a broken copyright #) symbol. In java code comments, I'd replace it with word *(copyright)*
    It is happening with 1.5 version only
    did you try it with 1.4 version on the same machine, with the same locale settings?
    Yes i tried and it is not giving such warnings.
  • 13. Re: java program Compiling using Maven
    807580 Newbie
    Currently Being Moderated
    gimbal2 wrote:
    I'm not going to teach you Java, sorry. Inheritance and polymorphism are the root of the language (or object oriented programming in general actually) and if you don't know enough about that, it will require a lot more study to get to grips with these terms. Typecasting is only a small part of it all, you need the bigger picture before you can understand it.
    But my question is it is not giving such warnings in 1.4 . From that warning itself it says about casting. But from a lower version to higher version when we tries to migrate this kind of issues makes trouble. So my doubt is like is there any other property or parameter that i have to add to remove those warnings. Because in my eclipse Galileo version i am not seeing such warnings. That is also using 1.5.

    Thanks
    Rasa.
  • 14. Re: java program Compiling using Maven
    807580 Newbie
    Currently Being Moderated
    rasa wrote:
    gimbal2 wrote:
    I'm not going to teach you Java, sorry. Inheritance and polymorphism are the root of the language (or object oriented programming in general actually) and if you don't know enough about that, it will require a lot more study to get to grips with these terms. Typecasting is only a small part of it all, you need the bigger picture before you can understand it.
    But my question is it is not giving such warnings in 1.4 . From that warning itself it says about casting. But from a lower version to higher version when we tries to migrate this kind of issues makes trouble. So my doubt is like is there any other property or parameter that i have to add to remove those warnings. Because in my eclipse Galileo version i am not seeing such warnings. That is also using 1.5.
    The eclipse IDE uses its own internal compiler and in the project properties there are a lot of "potential issues" for which you can configure action as error/warning/ignore.
    Maybe this one happens to be set to 'ignore'.
1 2 Previous Next