Xu Song

Greenhorn
+ Follow
since Nov 16, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Xu Song

True,there's a mistake in my build.xml.
In the <wtkpackage> task,if obfuscate is set with 'false',then the preverify should be 'false' as well.Because there's no .jar file existing in the project,it'll prompt "Preverification failed (result=1)" if preverify is set as true.
Solution:Set preverify in <wtkbuild> task as 'true'.If I obfuscate the built .jar file in <wtkpackage>,I got to set preverify as true in <wtkpackage>.

The tool is quite flexible,isn't it?
Xu Song
19 years ago
Hi,
I'm using antenna package for my J2ME project.The antenna-bin-0.9.13.jar is put under lib directory of my simple project,and '<property name="antenna.home" value="lib\antenna-bin-0.9.13.jar"/>' is defined in build.xml.
The compiling works well.I failed on preverfication.The error message is:
'Preverification failed (result=1)'.Then I use WTK's command line tool--preverify.exe,the preverification is success.
Your response would be appreciated very much.

regards,
Xu Song
19 years ago
The hidden swing-app is added to customer autostart folder after my software is installed on the PC.Actually I call this operation with:'init. setup for optimization'--one mandatory step of the whole installation procedure.

That's the same way when you install MS office,or some other huge MS applications:The installation wizard will setup initilization(similiar to add into autostart folder,could be in windows register) without prompt.

This procedure will shorten startup time on Java tiger platform as well.BTW,I found starting jEdit software would take longer time if I use tiger instead of JRE 1.4.2.It's tested on Windows 98.

Viele Gr��e

Xu Song
19 years ago
Hi all,
I think most of you have the experience:After launch a Java application,the sequential applications' startup time is shortened significantly.


My way-- To put a simple Swing application in the 'startup' folder of 'START->PROGRAMS' in Windows XP/2000/98.


To get good performance for MS Office program,Microsoft also puts initilization process at Window's start time.Why not let Windows do the same job for Java applications?This could make you have better position at customer side:"See,after window's long startup procedure,our Java applications run very quick!".
Your comments would be welcome.

Regards,
Xu Song

[ September 16, 2004: Message edited by: Xu Song ]
[ September 16, 2004: Message edited by: Xu Song ]
19 years ago
tough days in the past weekend,eventually I've got what I need.I think:Manning - SCWCD Exam Study Kit,the most suitable book for SCWCD 1.3.


Regards,
xusoo
19 years ago
Jeanne,
Triled but failed again.
I checked the help document:Workbench User Guide-->Ant & external tools tutorial-->Use cases for Ant in Eclise-->Ant buildfiles as project builder-->Creating a project builder Ant buildfile.
I can find in last paragraph of this page:"internal Eclipse Java compiler which in turn is responsible for indexing your source so that searching, refactoring and many other features are available. Thus it is not possible to replace the internal Eclipse Java compiler by using a project builder".
It seems that the default Java Builder is always mandatory though the last line in the page says 'you can disable the Java Builder'.
Anyway,my decision:Come back to the jEdit's ant plugin.Currently flexibility is more convenient than integration for me(compare jEdit with Eclipse).
Thanks a lot for your comments.

Regards,
Xu Song
Jeanne,
That's exactly the way I have tried.In project level preferences,I uncheck "Java Builder" in 'Builders config table'(it's impossible to remove),and new an 'ant builder'.I confirm I've disabled the 'Build automatically' option as well.
But it still reports:"The import my.lib cannot be resolved".

Regards,
Xu Song
Jeanne,
I'm using ant in Eclipse for the sample project.All ant build tasks(like compile,clean,dist) are executed successfully in the Eclipse Ant View.But in the java source file editor,Eclipse still prompt me:The import my.lib.* cannot be resolved.
If I migrate one Java project into Eclipse,should I add tens of external jars into Eclipse project properties by hand(Even though I completely use Eclipse ant view to build the project)?

Xu Song
Hi all,
A simple project,the external jar file is specified with CLASSPATH variable in the project's build.xml file.So the build can work well.But the Eclipse JDT still perform the checking syntax operation:There's red cross error sign at the "import my.lib.*" line.
Question:How can I disable the checking syntax(I don't want to add external jars in the project properties tab,since it's already specified in build.xml)?

Regards,
Xu Song
exactly,Dirk.I agree with your correction.
xusoo
19 years ago
Hi all,
The short conclusion for me:array is special.
In code 2),the 'object' variable pointing to a string object.So the casting is correct since the 'object' really is a String after the statement:
object="one".
In code 1),although all elements of the 'objects' variable are pointing to Strings after the statements,the 'objects' variable is still an object array.The casting is correct if and only if the 'objects' variable is defined as a String[].
Your comments is welcome.
xusoo
19 years ago
Hi all,
The short conclusion for me:array is special.
In code 2),the 'object' variable pointing to a string object.So the casting is correct since the 'object' really is a String after the statement bject="one".
In code 1),although all elements of the 'objects' variable are pointing to Strings after the statements,the 'objects' variable is still an object array.The casting is correct if and only if the 'objects' variable is defined as a String[].
Your comments is welcome.
xusoo
Hi,
Check the article from JavaWorld.com:
http://www.javaworld.com/javaworld/jw-07-2003/jw-0711-jedit.html

For me,I use AntForm,JBrowse plugins currently,on my poor P2-300M PC.But the performance is just very nice.
xusoo
Hi Dirk,
Check the following codes:
___________________________________________
code 1)
public class Foo{
public static void main(String[] args) {
Object[] objects = new Object[2];
objects[0] = "one";
objects[1] = "two";
String[] strings = (String[])objects;
}
}
___________________________________________
code 2)
public class Foo{
public static void main(String[] args) {
Object object = new Object();
object = "one";
String string = (String)object;
}
}
___________________________________________
The code 1) has a ClassCastException at runtime.But the code 2) results in no exception at runtime.In this case,The casting conversion does not work with Object array only.Do I understand correctly?
But array is also a kind of Object,why the casting conversion works on all kinds of object,only except for array?
I know a little about 'Pass by value/reference',Polymorphism.Otherwise it's a shame since I just passed SCJP several months ago.
But frankly,the campfire stories is very funny and helpful,and the 'remote controller'(object reference) impress me strongly.Thanks a lot for your recommendation reading.
xusoo
19 years ago
Hi all,
The solution is obviously correct:Using the overloaded toArray(Object[]).But I still cannot understand your explanation.
Check Chapter5.4 of the Java Language Specification v2.0:That's the casting conversion rules.Since the elements of new array and the old one are legal to cast(Object can be casted to String),there's no error in the compile-time.In run-time,even if the aList is added with String elements,the ClassCastException still prompted.I'm confused by this runtime exception actually.
Your comments would be appreciated very much.
regards
xusoo
19 years ago