Results 1 to 9 of 9
- 04-23-2008, 05:03 AM #1
Member
- Join Date
- Dec 2007
- Posts
- 30
- Rep Power
- 0
[SOLVED] An annoying warning everytime I compile
Everytime I compile a file I get this warning:
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...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.
- 04-23-2008, 05:14 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Seems this warning related to your application. Did you get this warning for simple applications, just like printing a message?
- 04-23-2008, 05:21 AM #3
Member
- Join Date
- Apr 2008
- Posts
- 15
- Rep Power
- 0
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, 05:25 AM #4
Member
- Join Date
- Dec 2007
- Posts
- 30
- Rep Power
- 0
Solved
Thanks, that solved it. I was doing exactly what you said.
- 04-23-2008, 05:28 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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?
- 04-23-2008, 05:30 AM #6
Member
- Join Date
- Dec 2007
- Posts
- 30
- Rep Power
- 0
I've got 1.6.0_01
- 04-23-2008, 05:36 AM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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.
- 04-23-2008, 08:03 AM #8
Member
- Join Date
- Apr 2008
- Posts
- 28
- Rep Power
- 0
netbeans 6.0.1 gives me that message
- 04-23-2008, 08:11 AM #9
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Use the same version and not for me. I don't think IDE effect for this. JDK version is the case.
Similar Threads
-
WARNING NetBeans HTTP Monitor
By bbq in forum JavaServer Pages (JSP) and JSTLReplies: 3Last Post: 09-19-2008, 06:02 PM -
doesn't compile?!
By jon80 in forum New To JavaReplies: 8Last Post: 06-14-2008, 05:42 PM -
Unable to compile
By gapper in forum New To JavaReplies: 2Last Post: 01-14-2008, 04:31 PM -
Not able to compile
By bugger in forum New To JavaReplies: 2Last Post: 01-09-2008, 10:13 PM -
warning: page has expired
By Peter in forum Web FrameworksReplies: 2Last Post: 07-04-2007, 07:45 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks