Xlint:unchecked compilation error?
Hello,
when i try to compile the following code as part of a servlet application , the following Xlint:unchecked error occurs.I cant understand since I am using jdk1.5 or is it referring to generics in collections?if so could anyone pls reply how to fix it.Thanks in advance.
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 Aile");
return (brands);
C:\javac BeerExpert.java
Note: BeerExpert.java uses unchecked or unsafe operations.
Note :Recompile with -Xlint:unchecked for details.
C:\javac BeerExpert.java
Note: BeerExpert.java uses unchecked or unsafe
operations.
Note :Recompile with -Xlint:unchecked for details.Yes it is referring to generics. The first step is to "Recompile with -Xlint:unchecked for details." like the compiler told you to do. That is
javac -Xlint:unchecked BeerExpert.java
Similar Messages
-
Compiling via XML file with Xlint:unchecked, JDK 1.5.0_05
compiling 1.4.2_04 code with 1.5.0_05 using an Ant/Tomcat environment and get the following Notes:
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
added this to my XML file to try to compile with unchecked:
<property name="compile.unchecked" value="true"/> <!-- added -->
<target name="compile">
<javac srcdir="${source.home}"
destdir="${deploy.home}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
unchecked="${compile.unchecked}" ><!-- added-->
optimize="${compile.optimize}"/>
</target>
Now I get this build error:
BUILD FAILED
file:C:/.../my_Build.xml:71: The <javac> task doesn't support the "unchecked" attribute.
This seems strange. Am I using unchecked incorrectly? This same code has <property name="compile.deprecation" value="true"/>, which functions and gives me more info on a few deprecated methods in the code, so I followed the same syntax.
Any suggestions would be appreciated. ThanksThank you - that did it.
I am new to Java and am wondering if you can give me any clue as to what an "unchecked call" means? How do I go about making it a "checked call"? If it is a warning and not an error, does it really matter? Can you point me to a good reference (online or book)?
This is the info I got on the xml file when I compiled with unchecked:
warning: [unchecked] unchecked call to addElement(E) as a member of the raw type java.util.Vector
[javac] searchThreads.addElement(temp);
This is the code it is looking at (mostly comments, but didn't want to strip them out):
// Create a vector to hold all of the search threads. 1000 should be more than enough.
Vector searchThreads = new Vector(1000);
// Start spawning search threads until the server socket is found, or until 1000 threads have been created.
while ((searchThreads.size() < 1000) && !found)
// We need to check to see if we've connected to the right server by reading what the server sent back to us.
//If it sent back the string "TM Server", then we're in the right place. If we get anything else, or we get nothing, then we need to keep looking.
// We spawn a thread for each socket to save time, and as soon as one of the threads finds the right socket, it sets a flag telling us to stop looking.
// Create and start the search thread
PortFinder temp = new PortFinder(tmHostName, startPort);
temp.start();
// Add the search thread to the vector THIS IS THE UNCHECKED CALL
searchThreads.addElement(temp);
// Increment to the next port before looping
startPort++;
Thanks -
What does -Xlint compile error mean?
I am new to Java.... I have an application and when I run the javac compiler I am getting the following error.
Note: InventoryFinal.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
So then I compiled using javac -Xlint and I get the following error
InventoryFinal.java:20: warning: [unchecked] unchecked conversion
found : java.util.ArrayList
required: java.util.ArrayList<Company>
al=new ArrayList();
^
1 warning
After I compile with the -Xlint switch the application runs as I expect it to. I am concerned about this message and would like to undestand how to fix the problemIt's not really an error. It's a warning. Actually it calls itself a "note".
"Lint" is the traditional name for a program or compiler option that checks another program for stylistic issues or potential problem areas, but which aren't necessarily wrong.
Your program should still run if all you get are warnings like these.
This warning is telling you that you're not using the parameterized types (aka generics) that were introduced in JDK 1.5. These allow you to make code that gets better type checking during compilation, which means that if your code has a bug you'll find it then, when compiling, and you won't have to be surprised with the bug during runtime. (The bug would still happen if it exists; you can just find out about it earlier when it's not a problem.)
Generics are a good thing. There are tutorials about them on this site and elsewhere. Google for them, find them, read them. -
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,
georginaThe 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.........
-
Set ojdeploy to include -Xlint:unchecked in it's compile
Having a very weird issue with ojdeploy.
The project compiles without errors via jDeveloper, but when I compile it through ANT using ojdeploy I get the following
[ora:ojdeploy] Note: Some input files use unchecked or unsafe operations.Some input files use unchecked or unsafe operations.
[ora:ojdeploy] Note: Recompile with -Xlint:unchecked for details.
How do I set -Xlint:unchecked for ojdeploy? (if that is even possible).
CheersHi DoctorZ,
in a VI is
a) the relative path if on the same drive,
b) the absolut path if on another drive,
c) the name only if the subVI is in vi.lib, user.lib or instr.lib
to all subVIs stored. So if your search path does not include and the subVI will always be found. The search path is only used when to load a VI that has moved from its original path or is a top level VI.
I have no place found to turn off this behavior.
I find this behavior is good. So we need not to maintain a list of search paths for each project since not all projects have the same directory layout. A lot of us work on more than one project within two weeks and we use often a lot of subdirs.
Also we maintain the project in a project directory. Each dev
eloper makes a local copy of the project. All paths are now correct and the developer can do his work. If he finished he closes LV, copies the VIs back to the project directory and can now open the project again from the project directory. And all the paths are correct again.
It is neccessary to close LV, so it forgets all the paths which are collected from the time when it was started.
Waldemar
Waldemar
Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions -
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..
Collinscontainer.getParameter() returns Object, not String.
try following:
String aq = (String) container.getParameter("AdjustmentQuantity");
if(aq.trim().startsWith("-"))
Regards
Stefan -
-Xlint: Unchecked Error Explanation
I have done a compile with -Xlint: Unchecked and i have got back the following results.
[Unchecked] Unchecked Conversion
[Unchecked] Unchecked Method invocation: <T>sort[java.util.List<T>,java.util.Comparator<? super T>in java.util.Collections is applied to [java.util.ArrayList<Album>, java.util.Comparator]It relates to
if ( type==( 1 ) )
Collections.sort(list, Album.NameComparator);
PrintJButton.doClick();
public int compareTo(Object anotherAlbum) //A compareTo method is needed when implementing comparable on your class
if( !(anotherAlbum instanceof Album) ) //comparing
throw new ClassCastException("Instance of Album expected"); //exception handling
int anotherAlbumArtistName = ((Album)anotherAlbum).getID(); //standard sort on my getID() method
return this.noOfTracks - anotherAlbumArtistName; //returns the inputs in sorted accesending order
public static Comparator NameComparator = new Comparator() //creating a new name comparator object which is integrated
//within my comparable Album.
public int compare(Object album, Object anotherAlbum) //Accepts to Album objects at a time for comparison
String make1 = ((Album)album).getName().toUpperCase(); //comparing on my Album Names
String make2 = ((Album)anotherAlbum).getName().toUpperCase();
return make1.compareTo(make2); //returning Album name sorted from a-z
public static Comparator cdComparator = new Comparator() //creating a new cd comparator
public int compare(Object album, Object anotherAlbum) //accepts to album ojects
String make1 = ((Album)album).getCD().toUpperCase(); //comparison on my cd names
String make2 = ((Album)anotherAlbum).getCD().toUpperCase();
return make1.compareTo(make2); //returning cd name sorted from a-z
}Does anyone know what is wrong?You've got two different things going on here. You're mixing Comparators and Comparables.
If Album is to be Comparable, then that means it has a "natural" order, and you'd declare it as public class Album impelements Comparable<Album>[/ode], and you'd provide a compareTo(Album) method so that it can be compared to other albums, and a list of Albums can be sorted without providing an external Comparator class.
If you just want Comparators--external classes that order pairs of Albums, then don't make Album Comparable, and don't implement compareTo.
Or, you can do both. -
Compilation error : package "coins" does not exist
Hi
I am new to Jva, though not new to programming.
I want to run a program I downloaded from internet But I cant since I got the following error
SimpleMain.java20 package coins does not exist.
import coins.HirRoot;
^(it points class HirRoot)
My GUESS is that I have to tell the compiler that I have my HirRoot class file somewhere. But I don't know how.
This is what I did:
I am at directory:
downloads/COINS/coinsBKP/examples/ And I want to compile SimpleMain.java inside of it
I have my classes (.class files) at directory:
downloads/COINS/coinsBKP/classes/coins/and Its source files (.java files) at directory:
donwloald/COINS/coinsBKP/src/coins/I input :
javac -d ../classes/coins/ SimpleMain.javaAnd I got many many errors.
What can I do?
btw I have tried also
javac -d ../classes/ SimpleMain.java
javac -d ./classes/ SimpleMain.javaand didn't work
Please help me, Any help will be greatly appreciated.Thanks for your answer.
But I still could not compile it ...
I did this...enriquez-guillermos-macbook:examples nacho$ javac -Xlint:unchecked -d ../classes/ -cp ../classes/ SimpleMain.java
SimpleMain.java:188: cannot find symbol
symbol : method setOptionalParam()
location: interface coins.sym.Subp
lPrintf.setOptionalParam();
^
SimpleMain.java:911: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
lList.add(hir.intConstNode(0));
^
SimpleMain.java:914: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
lList.add(lExpRepeat);
^
1 error
2 warnings
enriquez-guillermos-macbook:examples nacho$ As you suggested, I checked setOptionalParam() method. and it wasn't in Subp.java but it was found it in SubpImpl,java.
So How can I do this?
In C something like this might solutionate this problem...
#import "SubpImpl.java" but in java?
Also, I've noticed that SubpImpl is a Subclass of Subp so, importing or including a subclass "header" in the mother class file does not make sense Does it?
Is this a program problem or is the way I am compiling it? -
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 -
I have compiler error when i run the ant script
Hi
Iam a beginner working with ant...When I run the script I get the following error...let me know if you have any suggestions....
build:
[javac] Compiling 28 source files to C:\finaltrial\classes
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] Compiling 186 source files to C:\finaltrial\classes
[javac] error: error reading C:\finaltrial\classes\trial\impl\ru
ntime\AbstractUnmarshallingEventHandlerImpl.class; error in opening zip file
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error
Thanks in advance..that's not an error, it's a warning.
See the documentation on what causes that warning, it'll be an eye opener about the new language features introduced something like 2 years ago. -
Unknown compile error: Unsafe operations???
When i try to compile some of my code, i get this error :c:\File.\etc............... uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
What is this error?I don't understand what you mean lack of Generics, my code is listed below, can you give an example?
import javax.swing.*;
import java.io.*;
import java.util.*;
//v.size () will show length
public class Assignment3part2
public static void main(String arg[])
Vector studentVector = new Vector(3,2);
studentVector.add(new Student("Doe", "John", 1.5));
studentVector.add(new Student("Adams", "Sarah", 3.95));
studentVector.add(new Student("Smith", "Bob", 3.0));
Vector employeeVector = new Vector(3,2);
employeeVector.add(new Employee("Doe", "John", 20000));
employeeVector.add(new Employee("Adams", "Sarah", 15000));
employeeVector.add(new Employee("Smith", "Billy", 25000));
for (int i=0; i< studentVector.size(); i++)
System.out.println(studentVector);
for (int j=0; j< employeeVector.size(); j++)
System.out.println(employeeVector);
raise(studentVector, employeeVector);
for (int j=0; j< employeeVector.size(); j++)
System.out.println(employeeVector);
public static void raise(Vector s, Vector e)
for (int i=0; i< s.size(); i++){
for (int j=0; j< e.size(); j++){
Student st = (Student)s.get(i);
Employee emp = (Employee)e.get(j);
if (st.fName.equals(emp.fName) && st.lName.equals(emp.lName) && (st.gradePointAvg > 3)){
emp.salary = (emp.salary * 1.1);
e.set(j, emp.salary);
/* public static void DisplayStudent(Vector s);
for (int j=0; j< studentVector.size(); j++)
System.out.println(studentVector(j));
} -
10.1.3 Internal compilation error after unistalling extension cwd4all
I installed the cwd4all extension from the "check for updates" wizard.
Then i decided that I didn't need it so I uncheck it from the Tools>Preferences>Extensions but when I tried to compile apreviously working class I got an "Internal compilation error, terminated with a fatal exception" error.
Rechecking (i.e. reinstalling) the extension solved the problem, so then I removed both the jar and the relative folder from the extensions directory and I got the same error.
I don't want to reinstall the extension.
Any suggestions?Hi,
Extensions that are provided on the "Open Source and Partner Extensions" extension center are written by third parties and come with absolutely no warranty or guarantees whatsoever.
If you want to make sure you're running JDeveloper in a completely supported mode, you should uncheck the "Open Source and Partner Extensions" update center on the "Source" page of Check for Updates before checking for updates (or if you're installing updates via the automatic check balloon, only select extensions which are marked as being from the "Official Oracle Extensions" update center).
Brian -
TRIM() not found? Compile error: Can't find project or library in Excel 2007
I am preparing to make a few alterations to a spreadsheet that another person built. I have NOT made any changes to it yet.
They put in a button that allows portions of the worksheet to print. I am now using Excel 2007. Their code ran fine in 2003.
The button had worked in Excel 2003- but now (without any changes) throws an error "Compile Error: Cant find project or library."
TRIM is highlighted in the following code: (See below for the whole sub)
If Trim(Worksheets("Measurements").Cells(RowCounter, ColumnCounter).Value) <> "" Then
If RowCounter > PrintRowMarker Then
PrintRowMarker = RowCounter
End If
If ColumnCounter > PrintColumnMarker Then
PrintColumnMarker = ColumnCounter + 1
End If
End If
I have added in the following references into Excel via the big button in the upper left and the "Excel Options" screens:
Analysis Toolpak and Analysis Toolpak-VBA. The sheet "Measurements" is present.
1) Are these the right packages for the TRIM function?
2) Is there a different Add-in that is needed?
3) Is there an additional step I must use to actually add in these packages?
4) Is there something else I should do?
Thanks-
Loralee
P.S. Access 2003 finds (it's version of) TRIM fine- so a version is on the machine. This spreadsheet if failing in the same way on 2 machines- both with Office 2007 installed.
Private Sub BtnPrint_Click()
Dim RowStarter As Integer 'Where to start checking rows for content
Dim RowCounter As Integer 'The current row being checked
Dim ColumnCounter As Integer 'The current column being checked
Dim PrintRowMarker As Long 'The last row with data
Dim PrintColumnMarker As Long 'The last column with data
Dim NoMoreData As Boolean 'Look for a blank record
Dim RangeValue As String 'Define the range string value
Dim EndRangeValue As String
PrintColumnMarker = 0
PrintRowMarker = 0 'Initialize the row printing marker
RowStarter = 5 'Print Starting Point
For RowCounter = 2005 To RowStarter Step -1
For ColumnCounter = 50 To 2 Step -1
If Trim(Worksheets("Measurements").Cells(RowCounter, ColumnCounter).Value) <> "" Then
If RowCounter > PrintRowMarker Then
PrintRowMarker = RowCounter
End If
If ColumnCounter > PrintColumnMarker Then
PrintColumnMarker = ColumnCounter + 1
End If
End If
Next ColumnCounter
If PrintRowMarker > 0 Then
End If
Next RowCounter
EndRangeValue = IndexToString(PrintRowMarker, PrintColumnMarker)
RangeValue = "$A$1:" & EndRangeValue
Worksheets("Measurements").PageSetup.PrintArea = RangeValue
Worksheets("Measurements").PageSetup.PrintGridlines = True 'Turn on gridlines
Worksheets("Measurements").PrintPreview 'PRINT THAT PUPPY!
End SubAppears OK to me but the error message " Cant find project or library." suggests it could possibly be the references in VBA.
In VBA select menu item Tools - References.
Ensure that the following are checked:-
Visual Basic for Applications
Microsoft Excel 12.0 Object Library
OLE Automation
Microsoft Office 12.0 Object Library
It there are any references displayed as Missing then scroll down to find the equivalent reference and check it and then uncheck the Missing one/s.
Regards, OssieMac -
Java compile error for removed API
Hi,
What are the Java compile errors for API that has been removed?
As I understand it, API elements are deprecated and not removed from the API immediately, but will be removed in future releases or after so many years.
When Java code is compliled in a higher Java version, and the API has finally been removed - what are the errors that will be ouput in the log?
Thank you for your time.WalterLaan wrote:
And if you recompile one with a method removed that the other use and then run the other you would get a NoSuchMethodError (or more generally just an error sub class of LinkageError).
Not that you should be catching those unless you accept classes from the user (as plugins).Presumably you mean he should not be catching them?
@OP: In general, you should not catch unchecked exceptions. These are RuntimeException, Error, and their descendants. There are exceptions, such as at "layer boundaries," or when you don't want errors in one module/application/plugin/etc. to affect or prevent processing in others. -
-Xlint:unchecked for details
Note: C:\Documents and Settings\voonkt\Desktop\Work\Project (06-01-05)\SendComponent.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
What kind of warning is this? What can I do to resolve it?First, I'm going to assume that you're compiling with java 1.5/ In that case, the warning indicates that not all of your code is typesafed. That is to say the java wants you to use generics in your source code. Compiling with the -Xlint flag will cause javac to show you where it thinks you should be using generics.
Brent
Maybe you are looking for
-
WiFi on 2G Ipod Touch is very weak
I had the OLD Ipod Touch (32Gb) and sold it to buy the new 2G Ipod Touch. So far so good. Got speakers now and I'm happy. But before (with the OLD Touch) I was able to connect to my home wireless network from anywhere in the house. Now with the NEW 2
-
Which rights are required for a user to create a new database instance
Hi, Which user can create a database instance? Is it Admin or any user? or Is it must to have admin rights on the <oracle_home> folder in order to create a new database instance? Please let me know what rights the user should have for creating a new
-
will the new design iphone 4 be available to at&t customer?
-
I want to build a bok from several smaller books. Problem is the smaller books stand alone, they have a cover and TOC etc. I want to link the content of the small books but not the covers and toc into the larger book. Is this possible with ID? Ben
-
Wrong Times & Dates on calender
I hope someone can advise, when ever I sync my iphone to my mac laptop the dates and time are wrong. Some dates are on a different days or are different time to those that I put in. Please help it's very frustrating especially for reminders.