Use Unchecked or unsafe operations: recompile with -Xlint

hi all..
I'm trying to create a GUI to select the necessary port to open. I got this code from JAVA cookbook:
I'm using windows XP and JDK 1.6..
import java.io.*;
import javax.comm.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
public class PortChooser extends JDialog implements ItemListener {
HashMap map = new HashMap();
String selectedPortName;
CommPortIdentifier selectedPortIdentifier;
JComboBox serialPortsChoice;
JComboBox parallelPortsChoice;
JComboBox other;
SerialPort ttya;
JLabel choice;
protected final int PAD = 5;
public void itemStateChanged(ItemEvent e) {
selectedPortName = (String)((JComboBox)e.getSource()).getSelectedItem();
selectedPortIdentifier = (CommPortIdentifier)map.get(selectedPortName);
choice.setText(selectedPortName);
public String getSelectedName() {
return selectedPortName;
public CommPortIdentifier getSelectedIdentifier() {
return selectedPortIdentifier;
public static void main(String[] ap) {
PortChooser c = new PortChooser(null);
c.setVisible(true);// blocking wait
System.out.println("You chose " + c.getSelectedName() +" (known by " + c.getSelectedIdentifier() + ").");
System.exit(0);
public PortChooser(JFrame parent) {
super(parent, "Port Chooser", true);
makeGUI();
populate();
finishGUI();
protected void makeGUI() {
Container cp = getContentPane();
JPanel centerPanel = new JPanel();
cp.add(BorderLayout.CENTER, centerPanel);
centerPanel.setLayout(new GridLayout(0,2, PAD, PAD));
centerPanel.add(new JLabel("Serial Ports", JLabel.RIGHT));
serialPortsChoice = new JComboBox();
centerPanel.add(serialPortsChoice);
serialPortsChoice.setEnabled(false);
centerPanel.add(new JLabel("Parallel Ports", JLabel.RIGHT));
parallelPortsChoice = new JComboBox();
centerPanel.add(parallelPortsChoice);
parallelPortsChoice.setEnabled(false);
centerPanel.add(new JLabel("Unknown Ports", JLabel.RIGHT));
other = new JComboBox();
centerPanel.add(other);
other.setEnabled(false);
centerPanel.add(new JLabel("Your choice:", JLabel.RIGHT));
centerPanel.add(choice = new JLabel());
JButton okButton;
cp.add(BorderLayout.SOUTH, okButton = new JButton("OK"));
okButton.addActionListener(new ActionListener() {
     public void actionPerformed(ActionEvent e) {
          PortChooser.this.dispose();
/** Populate the ComboBoxes by asking the Java Communications API
* what ports it has. Since the initial information comes from
* a Properties file, it may not exactly reflect your hardware.
protected void populate() {
Enumeration pList = CommPortIdentifier.getPortIdentifiers();
while (pList.hasMoreElements()) {
CommPortIdentifier cpi = (CommPortIdentifier)pList.nextElement();
// System.out.println("Port " + cpi.getName());
map.put(cpi.getName(), cpi);
if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) {
serialPortsChoice.setEnabled(true);
serialPortsChoice.addItem(cpi.getName());
else if (cpi.getPortType() == CommPortIdentifier.PORT_PARALLEL) {
parallelPortsChoice.setEnabled(true);
parallelPortsChoice.addItem(cpi.getName());
else {
other.setEnabled(true);
other.addItem(cpi.getName());
serialPortsChoice.setSelectedIndex(-1);
parallelPortsChoice.setSelectedIndex(-1);
protected void finishGUI() {
serialPortsChoice.addItemListener(this);
parallelPortsChoice.addItemListener(this);
other.addItemListener(this);
pack();
//addWindowListener(new WindowCloser(this, true));
}}When i compile this it says PortChooser.java uses unchecked or unsafe operation
recompile with -Xlint(any one know what this is?)
Is it the JDK version i'm using ? First i thought it's a security issue.As in windows is not letting me access the serial ports.
I checked with device manager.My serial ports are open. Ichanged my BIOS settings as well..
(I read inputs from parallel port.But i dont use the comm api for that)
I have installed the rxtx gnu.io package as well..
Tried import gnu.io.* instead of javax.comm.*; still the same compilatiion error!!!
Thanks in advance
goodnews:-(

It is basically a warning (not an error) that the compiler gives you to let you know that you are using a raw type where Java now supports generic types.
For example, in the code you use:
HashMap where you can use HashMap<String,String> to let the compiler know that you intend inserting Strings for both the key and the value. The former is considered to be unsafe because the compiler cannot control what is inserted into the HashMap while in the latter case it can ensure that only Strings are used for both keys and values.
The compiler is also letting you know that if you want to see the details of these "unsafe" operations you can use the -Xlint:unchecked option when compiling and the compiler will show you exactly which lines contain the code that is generating the warning. So to compile with this option you would use javac -Xlint:unchecked ClassToCompile.

Similar Messages

  • Uses unchecked or unsafe operations with deserialization

    Ive read a lot of posts and they all seem to say it something wrong with my generics and / or casting of them and I can't figure out what's wrong?
    First I created a Map as follows:
    Map<String, Map<String, Integer>> map = new HashMap<String, Map<String, Integer>>();
    String a = "A";
    Map<String, Integer> nodesA = new HashMap<String, Integer>();
    nodesA.put("B", 6);
    nodesA.put("H", 10);
    String b = "B";
    Map<String, Integer> nodesB = new HashMap<String, Integer>();
    nodesB.put("A", 6);
    nodesB.put("H", 2);
    String c = "C";
    Map<String, Integer> nodesC = new HashMap<String, Integer>();
    nodesC.put("B", 9);
    nodesC.put("D", 2);
    nodesC.put("F", 7);
    nodesC.put("G", 6);
    nodesC.put("H", 5);
    String d = "D";
    Map<String, Integer> nodesD = new HashMap<String, Integer>();
    nodesD.put("C", 2);
    nodesD.put("F", 2);
    String e = "E";
    Map<String, Integer> nodesE = new HashMap<String, Integer>();
    nodesE.put("D", 4);
    nodesE.put("F", 1);
    String f = "F";
    Map<String, Integer> nodesF = new HashMap<String, Integer>();
    nodesF.put("C", 7);
    nodesF.put("D", 2);
    nodesF.put("E", 1);
    String g = "G";
    Map<String, Integer> nodesG = new HashMap<String, Integer>();
    nodesG.put("C", 6);
    nodesG.put("F", 8);
    nodesG.put("H", 3);
    String h = "H";
    Map<String, Integer> nodesH = new HashMap<String, Integer>();
    nodesH.put("A", 10);
    nodesH.put("C", 5);
    nodesH.put("G", 3);
    map.put(a, nodesA);
    map.put(b, nodesB);
    map.put(c, nodesC);
    map.put(d, nodesD);
    map.put(e, nodesE);
    map.put(f, nodesF);
    map.put(g, nodesG);
    map.put(h, nodesH);Then I serialized the map as follows:
    FileOutputStream fos = new FileOutputStream("data");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
    oos.writeObject(map);
    oos.close();
    fos.close();Then, in a different program, I tried to create a new map, set it to null to make 100% sure it was empty, and load in the map that I had saved, but when I try to compile this, I constantly get that uses unchecked or unsafe operations. I've tried all sorts of casting and such, and I can't figure out what it wants?
    Map<String, Map<String, Integer>> map = new HashMap<String, Map<String, Integer>>();
    map = null;
    output.println(map); 
    FileInputStream fis = new FileInputStream("data");
    ObjectInputStream ois = new ObjectInputStream(fis);
    map = (Map<String, Map<String, Integer>>) ois.readObject();
    ois.close();
    output.println(map); 

    The code you posted is correct, just add a @SuppressWarning("unchecked:). readObject returns an Object so you must cast and casting to a generic type will always produce a warning as the generic type information is erased (not available) at run time.
    You can read the warning in this case as 'possible class cast exception', which the compiler doesn't generate and you know that it shouldn't happen.

  • Warning : PerformRecord.java use uncheck or unsafe operations

    /*When compile (with version 1.5.0_05) have a warnning message
    Note : PerformRecord.java use uncheck or unsafe operations
    Note : Recompile wiht -XLint : uncheck for details
    How can I solve this problem*/
    this is my code :
    import java.sql.*;
    import java.util.*;
    public class PerformRecord
         public static final String DEFAULT_DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
    public static final String DEFAULT_URL = "Jdbc:Odbc:PersonalODBC";
    public static final String DEFAULT_USERNAME = "Personal";
    public static final String DEFAULT_PASSWORD = "moshan74";
         public Connection conn = null;
         public String querySQL;
         /*==Constructor class== */
         public PerformRecord()
              /*load JDBC driver*/
              try{
                   Class.forName(DEFAULT_DRIVER);
              }catch (ClassNotFoundException e){System.err.println(e.getMessage());}          
         /*===Method class*/
         /*set value for connection var*/
         public void getConnection()
              this.conn = setConnect();
         /*get QuerySQL*/
         public void setQuery(String sql)
              this.querySQL = sql;
         /*open connection */
         public Connection setConnect()
              try{
              conn = DriverManager.getConnection(DEFAULT_URL,DEFAULT_USERNAME,DEFAULT_PASSWORD);               
              }catch (SQLException e){System.err.print(e.getMessage());     }
              return conn;
         /*close connection*/
         public void closeConnect()
    try{
    conn.close();
    }catch (Exception e){ }
         /*execute query statement */
         public Object executeQuery()
              Object returnValue = null;
              try{
                   /*executing query and check result */
                   Statement stmt          = conn.createStatement();               
                   boolean hasResultSet = stmt.execute(querySQL);
                   if (hasResultSet)
                        /*get set of the record*/
                        ResultSet rs               = stmt.getResultSet();
                        /*get set of the column*/
                        ResultSetMetaData meta = rs.getMetaData();
                        /*amount column*/
                        int numColumns = meta.getColumnCount();
                        /*arrayLisst to add data*/     
                        List rows          = new ArrayList();
    while (rs.next())
    Map thisRow = new LinkedHashMap();// 1 element(1 row,i column)
    for (int i = 1; i <= numColumns; ++i)
    String columnName = meta.getColumnName(i);
    Object value = rs.getObject(columnName);
    thisRow.put(columnName, value);
    rows.add(thisRow);
    rs.close();
    stmt.close();
                   this.closeConnect();
    returnValue = rows;
    else
    int updateCount = stmt.getUpdateCount();
    returnValue = new Integer(updateCount);
              }catch (SQLException e){System.err.print(e.getMessage());     }
    return returnValue;
    ps>> I want to to use Generics to help it but I don't know how to do it in the right way . Can you you help me?
    Thanks
    Arunya

    regarding your Map/LinkedHashMap, since you keys are String and you values are Objects... you would define you Map using those two as you data type pair...
    ap<String,Object>thisRow = new LinkedHashMap<String,Object>();and similar for you List/ArrayList where you putting Maps into...
    List<Map<String,Object>> rows = new ArrayList<Map<String,Object>>();for more information on generics read...
    [url http://java.sun.com/docs/books/tutorial/java/javaOO/generics.html]Sun's The Java Tutorial : Generics
    - MaxxDmg...
    - ' He who never sleeps... '

  • Unchecked or Unsafe operation -- recompile

    Hi,
    How can I set compiler options in Jdeveloper?
    I am getting a
    Note: C:\JDeveloper10131\j2ee\home\application-deployments\AbcEJBTest\AbcEJB\ejb_webs
    ervice1\runtime\ControllerResponseElement_LiteralSerializer.java uses unchecked or unsafe operations
    Note: Recompile with -Xlint:unchecked for details.
    I am looking to recompile with the "-Xlint:unchecked" option.
    Thanks.

    See Generics : compiler option : unchecked conversion warnings

  • MyJava.java uses unchecked or unsafe operations

    I get the following warning message when I use ant from within Eclipse:
    compile:
    [javac] Compiling 2 source files to C:\eclipse\workspace\StoreInfo\build
    [javac] Note: C:\eclipse\workspace\StoreInfo\src\StoreInfo.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    I tried running my ant script from a dos prompt and still get the same message. I know its just a warning, but has anyone got a clue as to what the message means? How can I modify my ant script to recompile withe the -Xlint option?
    Thanks
    vedshar

    Vedshar,
    these messages occur when you are using classes that support the new J2SE 1.5 feature - generics. You get them when you do not explicitly specify the type of the collection's content.
    For example:
    List l = new ArrayList();
    list.add("String");
    list.add(55);If you want to have a collection of a single data type you can get rid of the messages by:
    List<String> l = new ArrayList<String>();
    list.add("String");If you need to put multiple data types into once collection, you do:
    List<Object> l = new ArrayList<Object>();
    list.add("String");
    list.add(55);If you add the -Xlint:unchecked parameter to the compiler, you get the specific details about the problem.
    Vita Santrucek

  • Jdeveloper warning uses unchecked or unsafe operations

    Greetings:
    I am getting warnings on my oc4j console that look like :
    Note: C:\product\10.1.3\OracleAS_1\j2ee\home\application-deployments\pl\plBeans\generated\PlLoginPrefixesEJB_StatelessSessionBeanWrapper9.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    I get these when I use a JDeveloper created SessionEJB bean. Is there something i can do to "fix" this or should i just ignore it?
    Thanks
    troy

    Hi,
    I have the following code which I have got from a book but when I compile I get a warning .... uses unchecked or unsafe operations.
    class CompTypeComparator implements Comparator
      public int compare(Object o1, Object o2)
        int j1 = ((CompType)o1).j;
        int j2 = ((CompType)o2).j;
        return (j1 < j2 ? -1 : (j1 == j2 ? 0 : 1));
    public class ComparatorTest
      public static void main(String[] args)
        CompType[] a = new CompType[10];
        Arrays2.fill(a, CompType.generator());
        System.out.println("before sorting, a = " + Arrays.asList(a));
        Arrays.sort(a, new CompTypeComparator());
        System.out.println("after sorting, a = " + Arrays.asList(a));
    }I have met this error before in other code from the book and have been able to sort it by myself. This one I could not solve since I do not fully understand the syntax of the Arrays.sort() method. IE
    sort(T[] a, Comparator<? super T> c)Presumably this error is because the book used an older version of the compiler than the version I am using (V5.0 or is it V1.5).
    Could anyone explain the error, how I can solve it and what the sort method means particularly "? super T"?
    Regards FarmerJo

  • Owner.java uses unchecked or unsafe operations.

         * addVecOwners() Method
         * @param g the is the Owner object
         * The method is used to add the owner
    public void addVecOwners(Owner ow)
        getVecOwners().add(ow);
    or
         * addVecBoats() method
         * @param bt holds the Boat object
    public boolean addVecBoats(Boat bt)
         boolean result = false;
         if( getVecOwnerBoats().contains(bt) == true )
              result = false;
         else
              getVecOwnerBoats().add(bt);
              result = true;
         return result;
    }          Above are the two type of sample coding I typed. I get the following errors when I typed it.
    Owner.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    Please help me to get ridof the warning messages.

    If you decide to use generics, you'll have to modify your code
    everywhere you use the collections.
    Before:
    private Vector vecOwners = new Vector();
    private Vector vecOwnerBoats = new Vector();
    public Vector getVecOwners()
        return vecOwners;
    public Vector getVecOwnerBoats()
        return vecOwnerBoats;
    public void addVecOwners(Owner ow)
        getVecOwners().add(ow);    
    public boolean addVecBoats(Boat bt)
        boolean result = false;
        if (!getVecOwnerBoats().contains(bt))
            getVecOwnerBoats().add(bt);
            result = true;
        return result;
    }With generics:
    private Vector<Owner> vecOwners = new Vector<Owner>();
    private Vector<Boat> vecOwnerBoats = new Vector<Boat>();
    public Vector<Owner> getVecOwners()
        return vecOwners;
    public Vector<Boat> getVecOwnerBoats()
        return vecOwnerBoats;
    public void addVecOwners(Owner ow)
        getVecOwners().add(ow);    
    public boolean addVecBoats(Boat bt)
        boolean result = false;
        if (!getVecOwnerBoats().contains(bt))
            getVecOwnerBoats().add(bt);
            result = true;
        return result;
    }Regards

  • X.java uses unchecked or unsafe operations - Confused.

    Coming back to java after a few years of strict C/C++ development, and wanted to start out with a few refresher apps - However, there's one issue that's been bothering me and it's the "uses unchecked or unsafe operations". Now, I'm aware that this is outputted when generics are used without fully qualifying the underlying types; However, like in the example below, I just cannot figure out where I need to include additional type definitions in order to rid myself of this error:
    import java.util.HashMap;
    public class Widget implements Cloneable {
        private HashMap<String, Object> myMap;
        public Widget( ) {
            myMap = new HashMap<String, Object>();
        protected Widget clone() {
            try {
                Widget cloneObj = (Widget) super.clone();
                cloneObj.myMap = (HashMap<String, Object>) myMap.clone();
                return cloneObj;
            } catch(CloneNotSupportedException ex) {
                //Should not occur since we implemented clone(...)
                return null;
    }javac complains that the line of code which clones 'myMap' is unsafe, but how?
    Any help?

    } catch(CloneNotSupportedException ex) {
    //Should not occur since we implemented clone(...)
    return null;
    }Just because you implement Cloneable doesn't necessarily make an object cloneable. In this case you're going to be ok, but try cloning a Thread or a Component and you will get the CloneNotSupportedException

  • ... uses unchecked or unsafe operations?

    Hi,
    I have the following code which I have got from a book but when I compile I get a warning .... uses unchecked or unsafe operations.
    class CompTypeComparator implements Comparator
    public int compare(Object o1, Object o2)
    int j1 = ((CompType)o1).j;
    int j2 = ((CompType)o2).j;
    return (j1 < j2 ? -1 : (j1 == j2 ? 0 : 1));
    public class ComparatorTest
    public static void main(String[] args)
    CompType[] a = new CompType[10];
    Arrays2.fill(a, CompType.generator());
    System.out.println("before sorting, a = " + Arrays.asList(a));
    Arrays.sort(a, new CompTypeComparator());
    System.out.println("after sorting, a = " + Arrays.asList(a));
    I have met this error before in other code from the book and have been able to sort it by myself. This one I could not solve since I do not fully understand the syntax of the Arrays.sort() method. IE
    sort(T[] a, Comparator<? super T> c)
    Presumably this error is because the book used an older version of the compiler than the version I am using (V5.0 or is it V1.5).
    Could anyone explain the error, how I can solve it and what the sort method means particularly "? super T"?
    Regards FarmerJo

    Hi,
    I have the following code which I have got from a book but when I compile I get a warning .... uses unchecked or unsafe operations.
    class CompTypeComparator implements Comparator
      public int compare(Object o1, Object o2)
        int j1 = ((CompType)o1).j;
        int j2 = ((CompType)o2).j;
        return (j1 < j2 ? -1 : (j1 == j2 ? 0 : 1));
    public class ComparatorTest
      public static void main(String[] args)
        CompType[] a = new CompType[10];
        Arrays2.fill(a, CompType.generator());
        System.out.println("before sorting, a = " + Arrays.asList(a));
        Arrays.sort(a, new CompTypeComparator());
        System.out.println("after sorting, a = " + Arrays.asList(a));
    }I have met this error before in other code from the book and have been able to sort it by myself. This one I could not solve since I do not fully understand the syntax of the Arrays.sort() method. IE
    sort(T[] a, Comparator<? super T> c)Presumably this error is because the book used an older version of the compiler than the version I am using (V5.0 or is it V1.5).
    Could anyone explain the error, how I can solve it and what the sort method means particularly "? super T"?
    Regards FarmerJo

  • Help in:  uses unchecked or unsafe operations. warnings problem

    need help in my assignment in these warnings problem, i tried it in different ways, one method lists from 0 to end where other should remove or add elements what is listed already,
    public  ArrayList collectModulos(int a){ // no warning in this method
            int [] tmp=new int[10];
            ArrayList <Integer> alst= new ArrayList<Integer>();       
            int i=1; 
            int k=a%i;
            while(i<tmp.length){
                if(a%i==0){               
                    alst.add(i);               
                }i++;          
            } alst.add(0,0);
            return alst;
        public ArrayList removeZero(int a){// warning in this method
            ArrayList <Integer> arl= new ArrayList<Integer>();
            arl=new ArrayList<Integer>(collectModulos(a).subList(1,collectModulos(a).size()));
            return arl;
        public static void main(String[] args){
            Modulos md=new Modulos();
            System.out.println(md.collectModulos(49)+"  "+md.removeZero(49));Modulos.java:36: warning: [unchecked] unchecked conversion
    found : java.util.List
    required: java.util.Collection<? extends java.lang.Integer>
    arl=new ArrayList<Integer>
    (collectModulos(a).subList(1,collectModulos(a)
    .size()));
    ^
    1 warning

    The warning must be because collectModulos(a).subList(1,collectModulos(a).size()) returns something that is not an ArrayList<Integer> - maybe just a plain ArrayList. If you're sure it's correct anyway, then you can ignore it.
    However, that method contains much more code than it needs to: You're initializing arl where you declare it, but then on the next line you're immediately initializing it again, discarding the first ArrayList you created. Better would be this:
         public ArrayList removeZero(int a){
            ArrayList<Integer> arl;
            arl=new ArrayList<Integer>(collectModulos(a).subList(1,collectModulos(a).size()));
            return arl;
        }Furthermore, you don't really need to create a local variable to return it, you can create and return an object in one go, like this:
         public ArrayList removeZero(int a){
            return new ArrayList<Integer>(collectModulos(a).subList(1,collectModulos(a).size()));
        }

  • .java uses unchecked or unsafe operations.

    I know why I get this error message, but I can't cope with it.
    I know it is the generics that are mssing, but I do not where to put them.
    I hava a class with a HashMap and I want to copy that HashMap to an oher class.
    This is the class where it is put and the method of getting the Hashmap:
    class Rute {
        HashMap <String,Losning> lagretLosningerFraNr = new HashMap <String,Losning>();
         HashMap giHash() {
              return lagretLosningerFraNr;
    And here is the class with the method of geting the HashMap, where I want it to be copied to:
    class Brett {
         Rute ru;
         HashMap <String,Losning> lagretLosningerFraNr;
         void hentHash() {
              this.lagretLosningerFraNr = ru.giHash();
         }

    I know why I get this error message, but I can't cope
    class Rute {
    HashMap <String,Losning> lagretLosningerFraNr =
    Nr = new HashMap <String,Losning>();
         HashMap giHash() {
              return lagretLosningerFraNr;
    You should return a gernericified map.
         HashMap<String,Losning> giHash() {
              return lagretLosningerFraNr;
         }(I'd also return a Map, over a HashMap, but that is me).

  • Recompile with -Xlint:unchecked for details???

    hi friends ,
    im using jdk-6-windows-i586. and apache-tomcat-5.5.26.
    In development phase i got the following error while compiling
    BeerExpert.java file. This is my model.
    Note: BeerExpert.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    But the class file is created. Is this any type of error or just warning msg.
    What is the meaning of this and what to do for it.
    Then I recompile the file with javac -Xlint BeerExpert.java or javac -Xlint:unchecked BeerExpert.java
    and the warning msg. appered as-
    BeerExpert.java:9: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
    brands.add("Jack Amber");
    error pos::: ^ error or warning position pointed by compiler
    4 warnings
    my source code is-
    package com.example.model;
    import java.util.*;
    public class BeerExpert {
    public List getBrands(String color) {
    List brands = new ArrayList();
    if(color.equals("amber")) {
    brands.add("Jack Amber");
    brands.add("Red Moose");
    else {
    brands.add("Jail Pale Ale");
    brands.add("Gout Stout");
    return(brands);
    Any suggestions what to do? Please..
    Thanx in advance.

    hi i have the same problem but my compiler is different
    it says note: stream.java uses or overrides depricated API
    recompile with XLINT:deprication for details
    @echo off
    :def
    color 0F
    :main
    cls
    title irans's Perfect Compiler
    echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    echo :: Welcome to the ultimate Serverbatch!
    echo ::
    echo :: Choose one of the options below by entering
    echo :: the corrensponding letter and pressing enter.
    echo ::
    echo :: Need a batch file created?
    echo :: http://www.Moparscape.org/smf.
    echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    echo :::: Main options:
    echo :::: com = Compile your server.
    echo :::: run = Run your server.
    echo :::: aur = Runs your server with autorestart.
    echo :::: bac = Backup your server files.
    echo ::::
    echo :::: Other options;
    echo :::: set = Change settings.
    echo :::: loc = Location list (co-ordinates)
    echo :::: upd = Updates
    echo :::: cmd = Command generator
    echo :::: cre = Credits
    echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    echo ::
    set /p mainc=:: Choice:
    if %mainc%==com goto com
    if %mainc%==run goto run
    if %mainc%==aur goto aur
    if %mainc%==bac goto bac
    if %mainc%==set goto set
    if %mainc%==loc goto loc
    if %mainc%==upd goto upd
    if %mainc%==cmd goto cmd
    if %mainc%==cre goto cre
    if %mainc%==COM goto com
    if %mainc%==RUN goto run
    if %mainc%==AUR goto aur
    if %mainc%==BAC goto bac
    if %mainc%==SET goto set
    if %mainc%==LOC goto loc
    if %mainc%==UPD goto upd
    if %mainc%==CMD goto cmd
    if %mainc%==CRE goto cre
    goto main
    :com
    cls
    title Compiling...
    echo :: Preparing for compile...
    echo :: Auto-setting envriomental variables...
    echo ::
    goto com2
    :com2
    title Compiling...
    echo :: Scanning for latest JDK version...
    echo ::
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_10\BIN" (GOTO COM10)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_09\BIN" (GOTO COM09)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_08\BIN" (GOTO COM08)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_07\BIN" (GOTO COM07)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_06\BIN" (GOTO COM06)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_05\BIN" (GOTO COM05)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_04\BIN" (GOTO COM04)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_03\BIN" (GOTO COM03)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_02\BIN" (GOTO COM02)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_01\BIN" (GOTO COM01)
    goto comerrorxxx
    :COM10
    echo :: Found JDK 1.6.0_10
    SET CLASSPATH=Files\Java\jdk1.6.0_10\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_10\bin
    echo :: Results:
    javac *.java
    echo :: Done!
    pause
    goto main
    :COM09
    echo :: Found JDK 1.6.0_09
    SET CLASSPATH=Files\Java\jdk1.6.0_09\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_09\bin
    echo :: Results:
    javac *.java
    echo :: Done!
    pause
    goto main
    :COM08
    echo :: Found JDK 1.6.0_08
    SET CLASSPATH=Files\Java\jdk1.6.0_08\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_08\bin
    echo :: Results:
    javac *.java
    echo :: Done!
    pause
    goto main
    :COM07
    echo :: Found JDK 1.6.0_07
    SET CLASSPATH=Files\Java\jdk1.6.0_07\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_07\bin
    echo :: Results:
    javac *.java
    echo :: Done!
    pause
    goto main
    :COM06
    echo :: Found JDK 1.6.0_06
    SET CLASSPATH=Files\Java\jdk1.6.0_06\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_06\bin
    echo :: Results:
    javac *.java
    echo :: Done!
    pause
    goto main
    :COM05
    echo :: Found JDK 1.6.0_05
    SET CLASSPATH=Files\Java\jdk1.6.0_05\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_05\bin
    echo :: Results:
    javac *.java
    echo :: Done!
    pause
    goto main
    :COM04
    echo :: Found JDK 1.6.0_04
    SET CLASSPATH=Files\Java\jdk1.6.0_04\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_04\bin
    echo :: Results:
    javac *.java
    echo :: Done!
    pause
    goto main
    :COM03
    echo :: Found JDK 1.6.0_03
    SET CLASSPATH=Files\Java\jdk1.6.0_03\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_03\bin
    echo :: Results:
    javac *.java
    echo :: Done!
    pause
    goto main
    :COM2
    echo :: Found JDK 1.6.0_02
    SET CLASSPATH=Files\Java\jdk1.6.0_02\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_02\bin
    echo :: Results:
    javac *.java
    echo :: Done!
    pause
    goto main
    :COM01
    echo :: Found JDK 1.6.0_01
    SET CLASSPATH=Files\Java\jdk1.6.0_01\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_01\bin
    echo :: Results:
    javac *.java
    echo :: Done!
    pause
    goto main
    :COMERRORXXX
    echo :: No version of JDK 1.6 was detected.wtf impossible
    pause
    goto main
    :run
    cls
    title Running Server...
    echo :: Port:
    echo :: 43594
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_10\BIN" (GOTO RUN10)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_09\BIN" (GOTO RUN09)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_08\BIN" (GOTO RUN08)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_07\BIN" (GOTO RUN07)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_06\BIN" (GOTO RUN06)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_05\BIN" (GOTO RUN05)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_04\BIN" (GOTO RUN04)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_03\BIN" (GOTO RUN03)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_02\BIN" (GOTO RUN02)
    IF EXIST "%programfiles%\JAVA\JDK1.6.0_01\BIN" (GOTO RUN01)
    :RUN10
    echo :: Running using JDK 1.6.0_10...
    SET CLASSPATH=Files\Java\jdk1.6.0_10\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_10\bin
    java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server
    echo :: Failed!
    pause
    goto main
    :RUN09
    echo :: Running using JDK 1.6.0_09...
    SET CLASSPATH=Files\Java\jdk1.6.0_09\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_09\bin
    java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server
    echo :: Failed!
    pause
    goto main
    :RUN08
    echo :: Running using JDK 1.6.0_08...
    SET CLASSPATH=Files\Java\jdk1.6.0_08\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_08\bin
    java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server
    echo :: Failed!
    pause
    goto main
    :RUN07
    echo :: Running using JDK 1.6.0_07...
    SET CLASSPATH=Files\Java\jdk1.6.0_07\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_07\bin
    java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server
    echo :: Failed!
    pause
    goto main
    :RUN06
    echo :: Running using JDK 1.6.0_06...
    SET CLASSPATH=Files\Java\jdk1.6.0_06\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_06\bin
    java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server
    echo :: Failed!
    pause
    goto main
    :RUN05
    echo :: Running using JDK 1.6.0_05...
    SET CLASSPATH=Files\Java\jdk1.6.0_05\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_05\bin
    java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server
    echo :: Failed!
    pause
    goto main
    :RUN04
    echo :: Running using JDK 1.6.0_04...
    SET CLASSPATH=Files\Java\jdk1.6.0_04\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_04\bin
    java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server
    echo :: Failed!
    pause
    goto main
    :RUN03
    echo :: Running using JDK 1.6.0_03...
    SET CLASSPATH=Files\Java\jdk1.6.0_03\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_03\bin
    java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server
    echo :: Failed!
    pause
    goto main
    :RUN02
    echo :: Running using JDK 1.6.0_02...
    SET CLASSPATH=Files\Java\jdk1.6.0_03\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_03\bin
    java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server
    echo :: Failed!
    pause
    goto main
    :RUN01
    echo :: Running using JDK 1.6.0_01...
    SET CLASSPATH=Files\Java\jdk1.6.0_03\bin;%CLASSPATH%;
    SET PATH=C:\Program Files\Java\jdk1.6.0_03\bin
    java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server
    echo :: Failed! Need JDK 1.6.0_xx
    pause
    cls
    goto main
    :bac
    :backup
    cls
    title Backing up files...
    echo :: Backing up files...
    if not exist Backup mkdir Backup
    if not exist Backup\characters mkdir Backup\characters
    if not exist Backup\connectedFrom mkdir Backup\connectedFrom
    if not exist Backup\data mkdir Backup\data
    if not exist Backup\flagged mkdir Backup\flagged
    if not exist Backup\logs mkdir Backup\logs
    if not exist Backup\moreinfo mkdir Backup\moreinfo
    if not exist Backup\savedGames mkdir Backup\savedGames
    Echo Starting Backup Copy
    copy /V /Y /A *.txt .\Backup\
    copy /V /Y /A *.java .\Backup\
    copy /V /Y /A *.class .\Backup\
    copy /V /Y /A *.cfg .\Backup\
    copy /V /Y /A *.bat .\Backup\
    copy /V /Y /A bans .\Backup\bans
    copy /V /Y /A characters .\Backup\characters
    copy /V /Y /A characters .\Backup\characters
    copy /V /Y /A connectedFrom .\Backup\connectedFrom
    copy /V /Y /A data .\Backup\data
    copy /V /Y /A flagged .\Backup\flagged
    copy /V /Y /A logs .\Backup\logs
    copy /V /Y /A moreinfo .\Backup\moreinfo
    copy /V /Y /A savedGames .\Backup\savedGames
    echo :: Done.
    pause
    cls
    goto main
    :set
    cls
    echo :: Enter one of the following to change background colour.
    echo :: B0 = Black
    echo :: B1 = Blue
    echo :: B2 = Green
    echo :: B3 = Cyan
    echo :: B4 = Red
    echo :: B5 = Purple
    echo :: B6 = Yellow
    echo :: B7 = White
    echo.
    echo :: Enter one of the following to change text colour.
    echo :: T0 = Black
    echo :: T1 = Blue
    echo :: T2 = Green
    echo :: T3 = Cyan
    echo :: T4 = Red
    echo :: T5 = Purple
    echo :: T6 = Yellow
    echo :: T7 = White
    set /p s=:: Choice:
    if %s%== B0 (set b=0)
    if %s%== B1 (set b=1)
    if %s%== B2 (set b=2)
    if %s%== B3 (set b=3)
    if %s%== B4 (set b=4)
    if %s%== B5 (set b=5)
    if %s%== B6 (set b=6)
    if %s%== B7 (set b=F)
    if %s%== T0 (set t=0)
    if %s%== T1 (set t=1)
    if %s%== T2 (set t=2)
    if %s%== T3 (set t=3)
    if %s%== T4 (set t=4)
    if %s%== T5 (set t=5)
    if %s%== T6 (set t=6)
    if %s%== T7 (set t=F)
    color %b%%t%
    pause
    cls
    goto main
    :loc
    cls
    echo :: Below is a list of locations with their coordinates.
    echo ::
    echo :: Varrock - 3210 3424
    echo :: Falador - 2964 3378
    echo :: Lumbridge - 3222 3218
    echo :: Camelot - 2757 3477
    echo :: East Ardougne 2662 3305
    echo :: West Ardougne 2529 3307
    echo :: Al Kharid 3293 3174
    echo :: Khalphite Lair 3226 3107
    echo :: Yannille 2606 3093
    echo :: Tutorial Island 3094 3107
    echo :: Barbarian Village 3082 3420
    echo :: Entrana 2834 3335
    echo :: Heroes Guild 2902 3510
    echo :: Rangers Guild 2658 3439
    echo :: Catherby 2813 3447
    echo :: Seers Village 2708 3492
    echo :: Fishing Guild 2603 3414
    echo :: Isafdar 2241 3238
    pause
    cls
    goto main
    :upd
    cls
    echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    echo :: Latest updates:
    echo ::
    echo :: 1) Added Location list.
    echo :: 2) Fixed backup commands.
    echo :: 3) Added settings option.
    echo :: 4) Fixed backup to cover more file types.
    echo :: 5) Added autorestarter. This was incredibly difficult for me to do.
    echo :: 6) Added command generator.
    echo :: 7) Auto-sets enviromental variables when compiling.
    echo :: 8) Released On Mopar Forums
    echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    pause
    cls
    goto main
    :cmd
    :Star
    Set /p CmdName=Command Input?
    Set /p RUSure=Are you sure you want the commands input: %CmdName%(yes,no)?
    If %RUSure%==no GOTO Star
    If not Exist CommandsFolder MD Commands Folder
    Echo else if(command.equalsignorecase("%CmdName%")) >> ".\Commands\%CmdName% Command.txt"
    Echo { >> ".\Commands\%CmdName% Command.txt"
    cls
    set /p AY=addItem(yes,no)?
    If %AY%==YES Goto addItem
    If %AY%==yes Goto addItem
    If %AY%==no Goto endCode
    If %AY%==NO Goto endCode
    :addItem
    cls
    set /p ID=ItemID?
    cls
    set /p Amount=Amount Of that Item?
    cls
    echo addItem(%ID%,%Amount%); >> ".\Commands\%CmdName% Command.txt"
    Set /P AT=Add item, add tele or finish command.(AI,T,End)
    If %AT%==ai GOTO addItem
    If %AT%==Ai GOTO addItem
    If %AT%==AI GOTO addItem
    If %AT%==aI GOTO addItem
    If %AT%==T GOTO Tele
    If %AT%==t GOTO Tele
    If %AT%==end GOTO endCode
    If %AT%==END GOTO endCode
    If %AT%==EnD GOTO endCode
    If %AT%==eNd GOTO endCode
    If %AT%==ENd GOTO endCode
    If %AT%==enD GOTO endCode
    if %AT%==End Goto endcode
    if %type%==* goto error
    echo.
    goto error
    :error
    cls
    echo Commands invalid. Only use commands from the menu.
    pause
    goto menu
    :endCode
    cls
    Echo } >> ".\Commands\%CmdName% Command.txt"
    Set /p Again=Make Another (yes, No)?
    If %Again%==yes GOTO Star
    If %Again%==no goto fin
    If %Again%==YES GOTO Star
    If %Again%==NO goto fin
    :Tele
    cls
    Set /P X=XCoord Tele?
    Set /P Y=YCoord Tele?
    Echo teleportToX = %X% >> ".\Commands\%CmdName% Command.txt"
    Echo teleportToY = %Y% >> ".\Commands\%CmdName% Command.txt"
    Set /P AT=addItem Or Another Tele(not Used In Same Command Usually(AI,T,End)
    If %AT%==ai GOTO addItem
    If %AT%==Ai GOTO addItem
    If %AT%==AI GOTO addItem
    If %AT%==aI GOTO addItem
    If %AT%==T GOTO Tele
    If %AT%==t GOTO Tele
    If %AT%==end GOTO endCode
    If %AT%==END GOTO endCode
    If %AT%==EnD GOTO endCode
    If %AT%==eNd GOTO endCode
    If %AT%==ENd GOTO endCode
    If %AT%==enD GOTO endCode
    if %AT%==End Goto endcode
    :fin
    echo Command creation complete. Find it in the commands folder.
    pause
    cls
    goto main
    :aur
    cls
    echo :: Have you already set up your autorestarter? (Y/N)
    set /p ans=:: Answer:
    if %ans%==y goto ansyes
    if %ans%==n goto ansno
    goto main
    :ansyes
    cls
    call autorestart.bat
    echo Not Found!
    pause
    goto main
    :ansno
    cls
    echo :: How long between auto restarts?
    set /p hlb=:: (10min, 12min, 14min, 16min, 18min, 20min):
    if %hlb%==10min goto min10
    if %hlb%==12min goto min12
    if %hlb%==14min goto min14
    if %hlb%==16min goto min16
    if %hlb%==18min goto min18
    if %hlb%==20min goto min20
    :min10
    del ProcessKiller.bat
    del Autorestart.bat
    del Runner.bat
    echo :start >> ProcessKiller.bat
    echo PING 1.1.1.1 -n 1 -w 600000 >> ProcessKiller.bat
    echo tskill java >> ProcessKiller.bat
    echo start call runner >> ProcessKiller.bat
    echo goto start >> ProcessKiller.bat
    echo java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server >> Runner.bat
    echo exit >> Runner.bat
    echo @echo off >> Autorestart.bat
    echo :start >> Autorestart.bat
    echo Start call "Runner.bat" >> Autorestart.bat
    echo call "ProcessKiller.bat" >> Autorestart.bat
    echo pause >> Autorestart.bat
    echo goto start >> Autorestart.bat
    goto donexd
    :min12
    del ProcessKiller.bat
    del Autorestart.bat
    del Runner.bat
    echo :start >> ProcessKiller.bat
    echo PING 1.1.1.1 -n 1 -w 720000 >> ProcessKiller.bat
    echo tskill java >> ProcessKiller.bat
    echo start call runner >> ProcessKiller.bat
    echo goto start >> ProcessKiller.bat
    echo java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server >> Runner.bat
    echo exit >> Runner.bat
    echo @echo off >> Autorestart.bat
    echo :start >> Autorestart.bat
    echo Start call "Runner.bat" >> Autorestart.bat
    echo call "ProcessKiller.bat" >> Autorestart.bat
    echo pause >> Autorestart.bat
    echo goto start >> Autorestart.bat
    goto donexd
    :min14
    del ProcessKiller.bat
    del Autorestart.bat
    del Runner.bat
    echo :start >> ProcessKiller.bat
    echo PING 1.1.1.1 -n 1 -w 840000 >> ProcessKiller.bat
    echo tskill java >> ProcessKiller.bat
    echo start call runner >> ProcessKiller.bat
    echo goto start >> ProcessKiller.bat
    echo java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server >> Runner.bat
    echo exit >> Runner.bat
    echo @echo off >> Autorestart.bat
    echo :start >> Autorestart.bat
    echo Start call "Runner.bat" >> Autorestart.bat
    echo call "ProcessKiller.bat" >> Autorestart.bat
    echo pause >> Autorestart.bat
    echo goto start >> Autorestart.bat
    goto donexd
    :min16
    del ProcessKiller.bat
    del Autorestart.bat
    del Runner.bat
    echo :start >> ProcessKiller.bat
    echo PING 1.1.1.1 -n 1 -w 960000 >> ProcessKiller.bat
    echo tskill java >> ProcessKiller.bat
    echo start call runner >> ProcessKiller.bat
    echo goto start >> ProcessKiller.bat
    echo java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server >> Runner.bat
    echo exit >> Runner.bat
    echo @echo off >> Autorestart.bat
    echo :start >> Autorestart.bat
    echo Start call "Runner.bat" >> Autorestart.bat
    echo call "ProcessKiller.bat" >> Autorestart.bat
    echo pause >> Autorestart.bat
    echo goto start >> Autorestart.bat
    goto donexd
    :min18
    del ProcessKiller.bat
    del Autorestart.bat
    del Runner.bat
    echo :start >> ProcessKiller.bat
    echo PING 1.1.1.1 -n 1 -w 1080000 >> ProcessKiller.bat
    echo tskill java >> ProcessKiller.bat
    echo start call runner >> ProcessKiller.bat
    echo goto start >> ProcessKiller.bat
    echo java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server >> Runner.bat
    echo exit >> Runner.bat
    echo @echo off >> Autorestart.bat
    echo :start >> Autorestart.bat
    echo Start call "Runner.bat" >> Autorestart.bat
    echo call "ProcessKiller.bat" >> Autorestart.bat
    echo pause >> Autorestart.bat
    echo goto start >> Autorestart.bat
    goto donexd
    :min20
    del ProcessKiller.bat
    del Autorestart.bat
    del Runner.bat
    echo :start >> ProcessKiller.bat
    echo PING 1.1.1.1 -n 1 -w 1200000 >> ProcessKiller.bat
    echo tskill java >> ProcessKiller.bat
    echo start call runner >> ProcessKiller.bat
    echo goto start >> ProcessKiller.bat
    echo java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server >> Runner.bat
    echo exit >> Runner.bat
    echo @echo off >> Autorestart.bat
    echo :start >> Autorestart.bat
    echo Start call "Runner.bat" >> Autorestart.bat
    echo call "ProcessKiller.bat" >> Autorestart.bat
    echo pause >> Autorestart.bat
    echo goto start >> Autorestart.bat
    goto donexd
    :donexd
    echo :: Autorestart configuration is complete. Choose 'y' at the menu.
    pause
    cls
    goto aur
    goto main
    :cre
    cls
    echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    echo :: Thanks you for using irans's ultimate Serverbatch!
    echo ::
    echo :: Thanks to:
    echo :: iran4life
    echo ::
    echo :: And you, if you have decided to use this
    echo :: instead of a different serverbatch (compiler).
    echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    pause
    cls
    goto main
    for some reason when i compile it says note: stream.java uses or overrides depricated API
    recompile with XLINT:deprication for details
    is there any errors ?
    help plz ive been trying for weeks and i went to ur link and still couldnt find...
    Edited by: imascape on Nov 5, 2008 8:18 PM

  • Compliation Error: Recompile with -Xlint:unchecked for details

    I am new to Java and am working through Sams Teach Yourself Java2 book. One of the examples gave me a compilation error. The problem code follows:
    C:\Java_Work\com\ramyam\ecommerce>java c Storefront.java
    Note: Storefront.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    package com.ramyam.ecommerce;
    import java.util.*;
    public class Storefront {
         private LinkedList catalog = new LinkedList();
         public void addItem(String id, String name, String price, String quant) {
              Item it = new Item(id, name, price, quant);
              catalog.add(it);
         public Item getItem(int i) {
              return (Item)catalog.get(i);
         public int getSize() {
              return catalog.size();
         public void sort() {
              Collections.sort(catalog);
    }I think it has something to do with the collections class being outdated. Does anyone have any idea how to fix this?
    Thanks in advance,
    georgina

    The book probably was published before Java had Generics. You can do as the error message says and recompile with the Xlint:unchecked option. Basically, you need to specify the type of objects you are putting into the LinkedList, something like      private LinkedList<Item> catalog = new LinkedList<Item>();This may cause you other errors.........

  • User defined function in PI 7.1 compilation error "Recompile with -Xlint"

    Hi All,
    I have a user defined function in PI 7.1 .,which is throwing the following error.
    Do i need to add any import statements like "import java.lang.String" in the beginning.
    It is unable to recognize the String methods used in the user defined function.
    E:\usr\sap\PID\DVEBMGS30\j2ee\cluster\server0\.\temp\classpath_resolver\Map02580a102a0911deb2b20019990eddfd\source\com\sap\xi\tf\_MM_C_to_Goods_.java:276:
    cannot find symbol
    symbol : method trim()
    location: class java.lang.Object
    if(container.getParameter("AdjustmentQuantity").trim().startsWith("-")){ ^
    Note: E:\usr\sap\PID\DVEBMGS30\j2ee\cluster\server0\.\temp\classpath_resolver\Map02580a102a0911deb2b20019990eddfd\source\com\sap\xi\tf\_MM_C_to_Goods_.java
    uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: E:\usr\sap\PID\DVEBMGS30\j2ee\cluster\server0\.\temp\classpath_resolver\Map02580a102a0911deb2b20019990eddfd\source\com\sap\xi\tf\_MM_C_to_Goods_.java
    uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    Any Help greatly appreciated..
    Collins

    container.getParameter() returns Object, not String.
    try following:
    String aq = (String) container.getParameter("AdjustmentQuantity");
    if(aq.trim().startsWith("-"))
    Regards
    Stefan

  • Error - Unchecked or unsafe operations

    import java.io.*;
    import java.util.*;
    public class Dictionary
         // data members
          Hashtable Dictionary = new Hashtable();
          // constructor
          public Dictionary()
              for(int i=0; i<256; i++)
              Dictionary.put(new Integer(i), new Integer(i));
       Gets the following error
    Note: Dictionary.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    Any ideas ?

    Ah, I'm getting soft: do this:
    import java.util.*;
    public class Dictionary  {
        Hashtable<Integer, Integer> Dictionary = new Hashtable<Integer, Integer>();
        public Dictionary() {
            for(int i=0; i < 256; i++)
              Dictionary.put(new Integer(i), new Integer(i));
    }Tutorial: http://java.sun.com/docs/books/tutorial/extra/generics/index.html

Maybe you are looking for