|
|
|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

04-23-2008, 06:03 AM
|
|
Member
|
|
Join Date: Dec 2007
Posts: 30
|
|
|
[SOLVED] An annoying warning everytime I compile
Everytime I compile a file I get this warning:
Note: C:\Documents and Settings\<user name>\Desktop\Multiple Desktops\DesktopArray.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Process completed.
The file performs some basic file creation and movement in a folder in the C drive. If the code is needed I could provide it. I was wondering if there is a way I could stop this message from displaying every time I compile. I use JCreator if that matters at all...
|
|

04-23-2008, 06:14 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,543
|
|
|
Seems this warning related to your application. Did you get this warning for simple applications, just like printing a message?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-23-2008, 06:21 AM
|
|
Member
|
|
Join Date: Apr 2008
Posts: 3
|
|
|
ive had this. basicly if you have any sort of Collection. like a ArrayList, HashSet ect you have to tell the compiler what Type of variables are going to be in it. for example
ArrayList list = new ArrayList(); will give u that warning
ArrayList<String> list = new ArrayList<String>(); will get rid of the warning because you told the compiler that your going to put strings in it. just change it to Integers or Objects or whatever your going to put in it.
|
|

04-23-2008, 06:25 AM
|
|
Member
|
|
Join Date: Dec 2007
Posts: 30
|
|
|
Solved
Thanks, that solved it. I was doing exactly what you said.
|
|

04-23-2008, 06:28 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,543
|
|
|
Interesting, Netbeans or Eclipse doesn't give this warning at all. Typically ArrayList can hold any primitive data type, no need to specified. What Java version you guys use?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-23-2008, 06:30 AM
|
|
Member
|
|
Join Date: Dec 2007
Posts: 30
|
|
|
I've got 1.6.0_01
|
|

04-23-2008, 06:36 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,543
|
|
|
I used 1.6.0_05 with Netbeans. So there is a bit different(actually improvement) in exceptions. Because I don't get such warnings in my applications.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-23-2008, 09:03 AM
|
|
Member
|
|
Join Date: Apr 2008
Posts: 28
|
|
|
netbeans 6.0.1 gives me that message
|
|

04-23-2008, 09:11 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,543
|
|
|
Use the same version and not for me. I don't think IDE effect for this. JDK version is the case.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
All times are GMT +3. The time now is 06:54 PM.
|
|
VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org