Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Java program won't run due to -Xlint

  • 07-04-2006 7:00pm
    #1
    Registered Users, Registered Users 2 Posts: 3,804 ✭✭✭


    Hey, i just got an assignment to do over the easter break. I was given the source code and now i have to make changes to it. I did a bit of work on it in college and it worked fine, but when i went to work on it at home, this message came up when i compile it:
    Note: C:\Documents and Settings\David\Desktop\New Folder\Aquarium.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.

    Tool completed successfully

    I'm using Textpad to compile and run the program. How do i uncheck -Xlint, and what is -Xlint?


Comments

  • Registered Users, Registered Users 2 Posts: 362 ✭✭theone


    chk the version of java your using to compile your program at home it might be a later version than the one you are using in college,try using the same java version thats in college,

    Taking a guess the methods you are using are depreciated so the java version your using at home is more current than the one your using in college.


  • Registered Users, Registered Users 2 Posts: 3,804 ✭✭✭Benzino


    My version is 5.0 update 6, well that's what jt's saying anyway. I have only recently installed java. There are 5 imports into the program:

    java.awt,*;
    java.util,*;
    java.lang.Math;
    java.awt.event,*;

    So the only way to get around this is to get the same version of java that my college has?

    I hope the college is gonna be open during the next week, cause i won't be able to get it done!!!

    Thanks for your help


  • Closed Accounts Posts: 1,502 ✭✭✭MrPinK


    Those are just warnings though, it will still be compiling just fine. Xlint is a command line option to see the details of the warnings. You use: 'javac -Xlint MyClass.java' to view the details when compiling from the command line. I'm not familiar with textpad though, there should be some option for setting VM arguments somewhere. Or you can just ignore them.

    EDIT: it's mostly cause by unparameterised collections. Generics was only introduced in 1.5, which is why you only get the warnings at home. If they're using 1.4 in college then you shouldn't fix them, or it won't compile at all in college. Just ignore the message, or use the '-nowarn' compile option to make them disappear


  • Registered Users, Registered Users 2 Posts: 362 ✭✭theone


    I never got a message like that so I'm just guessing.

    try uninstalling the java version you have and installing an earlier one maybe that will work.


  • Registered Users, Registered Users 2 Posts: 3,804 ✭✭✭Benzino


    I think i'll have to install an older versiom. The program conists of fish moving arounding the screen etc. But when i run the program the fish move, then stop, then move again, just like bad frame rates in a game. Of course this could be the code, but it did work fine in the college. I'll try version 1.4 and see if that helps.

    thanks for your help.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,275 ✭✭✭bpmurray


    Just follow the instructions. It's saying to recompile with -Xlint:unckecked, so just do it! In other words, you're compiling with javac <options> <files>, just add the option: "-Xlint:unchecked" to the other options.


  • Registered Users, Registered Users 2 Posts: 2,133 ✭✭✭Explosive_Cornflake


    Just a suggestion, get eclipse, it's free, and it's the shít for writing java in.


Advertisement