OK, I've been testing the problems are these:
I have 2 packages X, Y.
X contains classes 1,2,3,4,5
Y contains A.
Class 1 = main class.
It loads class A.
Class A extends from Class 2 and also imports classes 3,4.
Now I install package X under classpath /a/b/c.
I place package Y under another...
I'm trying to implement dynamic class loading using:
Class.forName(className, true, Thread.currentThread().getContextClassLoader());
Class A (which is a jar file residing in the /jre/lib/ext dir ) that I'm loading extends class B (which is packaged as a separate package with the main...
I've got a .sh script that uses various functions within it. It looks something like this:
x="text.sh $a"
function run
(
a=1
exec $x
)
run
When I run the script, the script complains that $a is empty. Why does the value of '1' not get passed when $x is executed???
I'm using ksh with the following script snippet:
SERVER_PREFIX="Server:"
read role <someFile
name=${role}#$SERVER_PREFIX}
This works fine but when I run it in Bourne shell, I get an error.. 'bad subsitution' for the last line of script.
Does anyone know what the correct syntax is?
Thx. Thats works fine. However, when I do something like this..
x=0
while read each line
do
# SKIP BLANK LINES.
y=`echo ${each_line} | wc -w`
if [ $y != 0 ]
then
echo "blah"
x=`expr $x + 1`
fi
done < /tmp/test.txt
echo $x
Now x should...
Hi,
I've got a Bourne .sh script that has a while do loop. Pseudo code as follows:
x=0
while x<10
do
echo x
x=x+1
done
echo "last value of x is $x"
The last echo statement returns 0. Is there a way to get the value of x from the last invocation of the while loop i.e x=9???
How do I read an xml file that has been compressed with Unix gzip? I tried using GZIPInputStream but I get errors relating to "unsupported five or six byte UTF-8 sequence".
I'm doing something like
TimerTask a = new TimerTask();
run(){
...
}
TimerTask b = new TimerTask();
run(){
...
}
timer.schedule(a, ...)
timer.schedule(b, ..)
It seems to be working but I wonder if this is the correct and optimized way to code.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.