vidu mayur

Ranch Hand
+ Follow
since Nov 13, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by vidu mayur

Thanks a lot! That worked perfectly!
20 years ago
Hi
There is a LinkedList with elements which have a key and a value. For example.,
List ls contains
1=one
2=two
3=three
I want this to be mapped as
HashMap hm = {1=one, 2=two, 3=three}
How do I do that?
Thanks in advance
Vidu
20 years ago
Hi all
I found the error. The list didn't have any values in it.
Thanks
Vidu
20 years ago
Hi Nancy
I studied java from a great book. Title: Programming from the beginning by K.N. King. There is a website which also teaches about many concepts in detail. When I want to go back to check on any topic, I refer to this website.
Dick Baldwin's introductory java tutorial

Hope this helps
Vidu
20 years ago
Hi all
I was trying to reverse a HashMap and it compiled fine. When I executed it, it gave me a java.lang.OutOfMemoryError. Then, I restarted the PC and tried executintg other working programs/this program, the process never ends. I want to execute other programs now. Please help me!
P.S: If you want to look at the code which caused all this, please see below

Thanks in advance
20 years ago
Hi all
Found out that I hadn't mounted that specific package. That was the reason for the error.
Thanks
vidu
20 years ago
Hi All
sorry for the numerous messages. Once I added the C:\j2sdk1.4.2_01\lib\tools.jar to the classpath, it is working. I still have one more question. When I run ant in the directory, all my files are getting compiled and the application starts and runs fine too using the produced jar files. But I get error markers in the files when I open it in Netbeans and it says invalid package declaration. What will be the reason?
Thanks
Vidu
20 years ago
Hi Paul
I changed the classpath so that it included the jar files ant-launcher.jar and optional.jar. I didn't get the NoClassDefError after that.
I set the path manually to C:\ant\bin and tried ant in the directory where the build file was. It gives me this message
C:\Documents and Settings\RAMESH\.netbeans\3.5\trialprograms\FR\or>ant
Buildfile: build.xml
init:
[mkdir] Created dir: C:\Documents and Settings\RAMESH\.netbeans\3.5\trialprograms\FR\build
compile:
[javac] Compiling 56 source files to C:\Documents and Settings\RAMESH\.netbeans\3.5\trialprograms\FR\build
BUILD FAILED
C:\Documents and Settings\RAMESH\.netbeans\3.5\trialprograms\FR\or\build
.xml:17: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
Total time: 5 seconds
C:\Documents and Settings\RAMESH\.netbeans\3.5\trialprograms\FR\or>
I even tried setting the JAVA_HOME manually to set JAVA_HOME=C:\j2sdk1.4.2_01\bin
Is this how I set it manually? Please let me know.
Thanks
Vidu
20 years ago
Hi Paul
I deleted the ant1.6.0 bin distribution and downloaded ant nightly build files ant apache alpha1.6. I downloaded antbin into C:\ant directory
when I typed set from the C:\ant\bin directory, this was shown
C:\ant\bin>set
ANT_HOME=C:\ant;
classpath=.;C:\ant\lib\ant.jar;C:\ant\lib\xercesImpl.jar;C:\ant\lib\xml-apis.jar;
HOMEPATH=\Documents and Settings\RAMESH
JAVA_HOME=C:\J2sdk1.4.2_01;
Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Documents and Settings\RAMESH\j2sdk1.4.2_01\BIN;C:\j2sdk1.4.2_01\BIN;C:\Documents and Settings\Ramesh\jbproject;C:\Programfiles\putty\path\to\putty\
directory;%ANT_HOME%\bin;%JAVA_HOME%\bin;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
I set the environment variables as shown:
path %ANT_HOME%\bin;%JAVA_HOME%\bin
JAVAHOME: C:\j2sdk1.4.2_01
classpath C:\ant\lib\ant.jar;C:\ant\lib\xercesImpl.jar;C:\ant\lib\xml-apis.jar
ANT_HOME c:\ant
When I run ant from C:\ant\bin, I get this error
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher
Thanks for taking the time to look into it. Please tell me what I have to change in the classpath.
Vidu
20 years ago
Hi
I downloaded the ant nightly build apache ant alpha1.6 and changed the environment variables to
path %ANT_HOME%\bin;%JAVA_HOME%\bin
JAVAHOME: C:\j2sdk1.4.2_01
classpath C:\ant\lib\ant.jar;C:\ant\lib\xercesImpl.jar;C:\ant\lib\xml-apis.jar
ANT_HOME c:\ant
When I run ant from C:\ant\bin, I get this error
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher
Please help me
Thanks
Vidu
20 years ago
Path= %ANT_HOME%\bin; C:\Documents and Settings\User\.netbeans\3.5\trialprograms\fr\or\op\bin;;%ANT_HOME%\bin; PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
The name of the directory from where I typed set path is this:
C:\Documents and Settings\User\.netbeans\3.5\trialprograms\FR\or\op>set path
I added bin at the end of the directory's name in the path value. Is it ok. Still I am getting the same error from this directory. Please let me know the mistake I am doing.
thanks
Vidu
20 years ago
Hi
I am new to Ant and when I try to run a Build.xml file from netbeans, it compiles, distributes and builds the application , but it gives error markers for the same files. Though the files are in the right packages, it gives invalid package declaration. It compiles the sourcefiles to another folder in the same directory. Those files have a red X on them.
Do I use default compiler as Indirect Ant compilation to compile all the files using build.xml and default executor is Ant script execution. Do i have to change any of this?
I really need help here.
thanks
vidu
I did execute it from the directory where the Build.xml is. It again gives ant is not recognized as an internal or external command or batch file.
When I try to run it from netbeans, it compiles, distributes and builds the application , but it gives error markers in the files. When the files are in the right packages, it gives invalid package declaration.
I really need help here.
thanks again
vidu
20 years ago
When i tried to go into the bin directory and type ant, it gives me Build.xml file not found now. I don't have any Build.xml file in that directory. So that is ok. But I have to compile using ant in a different directory where the Build.xml file exists. Should I add that directory to the path variable or classpath variable. I know that I am asking a silly question. But I am just not able to find where that mistake is. Please help me!
thanks
Vidu
20 years ago
Hi All
I am using Ant for the first time and it gives me an error ant is not recognized as an internal or external command or batch file
I downloaded ant 1.6.0 bin in a directory in C called as ANT_HOME and extracted the files in subfolder apache-ant-1.6.0-bin into its subfolder apache-ant-1.6.0. This binary ditribution came with Apache Xerces 2 XML parser. According to the installation instructions, I added XML parser's jar files and ant.jar files in the classpath variable in win XP and also set the ANT_HOME, JAVA_HOME and added the path variable as shown.
classpath: .;C:\ANT_HOME\apache-ant-1.6.0-bin\apache-ant-1.6.0\lib\ant.jar;C:\ANT_HOME\apache-ant-1.6.0-bin\apache-ant-1.6.0\lib\xercesImpl.jar;C:\ANT_HOME\apache-ant-1.6.0-bin\apache-ant-1.6.0\lib\xml-apis.jar;
ANT_HOME: C:\ANT_HOME\apache-ant-1.6.0-bin\apache-ant-1.6.0
JAVA_HOME: C:\J2SDK1.4.2_01
Path: %PATH%;%ANT_HOME%\bin
javac and java work from command line. What is wrong here? I know you have answered a similar question to another person in the same forum. But I am not able to get it when I did it like that either. Please help me
thanks in advance
vidu
20 years ago