How to recompile with -Xlint: unchecked?

I keep getting this post in BlueJ / Java.

http://cache.gyazo.com/19c325e77bbc120892d1035dcfda5377.png

I know that StackOverflow already has several other similar questions, but none of the answers were specific enough for me, Java noob. For example, one of them said to add something to the javac command line, "and I have no idea what it is. So use this information to know how specifically you should be with me. Sorry. Thank you!

+6
source share
3 answers

open a command prompt in the directory with the source files. then enter javac -Xlint:unchecked *.java

+4
source

Please refer to the BlueJ FAQ , which has an exact answer.

Edit: Sorry for running away. This is what frequently asked questions for Windows. Go to the Bluej installation directory and open the lib\bluej.defs . Then go to the section that says bluej.windows.vm.args and add the value that another user said.

So you have:

 bluej.windows.vm.args=-Xlint:unchecked 

I would listen to paulsm4 tips and start learning on the command line if you really want to understand java. This is the best I can do.

+3
source

@ viggom555:

Here is an example command line:

1) Create the file "ATest.java" (EXAMPLE: notepad ATest.java):

 import java.util.*; public class ATest { public static void main (String[] args) { ArrayList<String> test = new ArrayList<String>(); System.out.println ("My array has " + test.size() + " items"); test.add ("abc"); System.out.println ("My array has " + test.size() + " items"); } } 

2) Compile (EXAMPLE: "javac -Xlint: unchecked ATest.java", you do not need "XLint" in this example, I will just show you where it will go if you want):

 C:\temp>javac -Xlint:unchecked ATest.java 

3) Run the test program:

 C:\temp>java ATest My array has 0 items My array has 1 items 

I hope this helps .. PSM

+2
source

Source: https://habr.com/ru/post/917050/