Menu

#18 Xerces, JDK 1.3.1 and Eclipse 2.0.2

AntView_2.X
closed-fixed
General (21)
5
2002-11-26
2002-11-11
No

Hi,

I downloaded the source to AntView 2.2.8 because it
kept throwing errors when I'd try to start it from the latest
Eclipse -- Nov. 7 integration build of the 2.0.2 line.

In the source, I found one JDK 1.4 API-ism in
com.r2tech.eclipse.antview.views.AntViewContentProvide
r, where you're using the new String.split() method. This
won't compile or run under JDK 1.3.x. If you're
interested in a cross-version fix, the simplest thing was
to use a StringTokenizer:

// SMS - simple fix to compile under 1.3.1
// String targets[] = targetsPref.split(SEP_REC);
StringTokenizer tokenizer = new StringTokenizer
(targetsPref, SEP_REC);
int size = tokenizer.countTokens();
String targets[] = new String[size];
for (int i = 0; i < size; i++) {
targets[i] = tokenizer.nextToken();
}

Another thing was compiling against this latest rev of
Eclipse required some classpath changes. I actually
added an "eclipse.home" property to the build.xml and
used sed to replace all the occurrences of "../../" in the
classpath with "${eclipse.home}" and then I upped all
the minor version numbers of plugins that needed to be
tweaked. I'll paste it here. Hopefully it can be copied
and pasted if you want to use it.

<javac destdir="${temp.folder}/antview.jar.bin"
failonerror="false" verbose="true" debug="on"
includeAntRuntime="no"
bootclasspath="${bootclasspath}"
classpath="${eclipse.home}/plugins/org.eclipse.core.res
ources.win32_2.0.1/resources.jar;${eclipse.home}/plugin
s/org.eclipse.ui.externaltools_2.0.1/externaltools.jar;${ecl
ipse.home}/plugins/org.eclipse.swt_2.0.1/ws/
${ws}/swt.jar;${eclipse.home}/plugins/org.eclipse.core.bo
ot_2.0.1/bin;${eclipse.home}/plugins/org.eclipse.core.run
time_2.0.2/runtime.jar;${eclipse.home}/plugins/org.eclips
e.core.boot_2.0.2/boot.jar;${eclipse.home}/plugins/org.ap
ache.ant_1.4.1/jakarta-ant-1.4.1-
optional.jar;${eclipse.home}/plugins/org.eclipse.ui.win32_
2.0.0/workbench.jar;${eclipse.home}/plugins/org.eclipse.
ui.externaltools_2.0.1/bin;${eclipse.home}/plugins/org.ecl
ipse.ant.core_2.0.1/bin;${eclipse.home}/plugins/org.eclip
se.swt_2.0.2/bin;${eclipse.home}/plugins/org.eclipse.cor
e.resources_2.0.1/bin;${eclipse.home}/plugins/org.eclips
e.core.resources_2.0.1/resources.jar;lib/jdom.jar;${eclips
e.home}/plugins/org.eclipse.swt.win32_2.0.2/ws/
${ws}/swt.jar;${eclipse.home}/plugins/org.eclipse.ui_2.0.
2/workbench.jar;${eclipse.home}/plugins/org.eclipse.core
.runtime_2.0.2/bin;${eclipse.home}/plugins/org.eclipse.an
t.core_2.0.1/antsupport.jar;${eclipse.home}/plugins/org.a
pache.ant_1.4.1/bin;${eclipse.home}/plugins/org.apache.
ant_1.4.1/ant.jar;${eclipse.home}/plugins/org.eclipse.ui_2
.0.2/bin;${eclipse.home}/plugins/org.eclipse.ui.win32_2.0
.0/workbenchwin32.jar;${eclipse.home}/plugins/org.apach
e.xerces_4.0.7/xmlParserAPIs.jar">

Finally, "out of the box" I was having XML API and
parser classpath and NoClassDefFoundErrors like so:

java.lang.NoClassDefFoundError:
org/xml/sax/SAXParseException
at
com.r2tech.eclipse.antview.views.AntView.createPartCon
trol(AntView.java:66)

To fix this I added <import plugin="org.apache.xerces"/>
to the <requires> element.

Discussion

  • Scott Stirling

    Scott Stirling - 2002-11-11

    modified build file for Eclipse 2.0.2 libs

     
  • Scott Stirling

    Scott Stirling - 2002-11-11

    Logged In: YES
    user_id=136722

    After seeing the pasted classpath formatting above, I figured I
    better just attach the file.

     
  • Scott Stirling

    Scott Stirling - 2002-11-11

    modified build file for Eclipse 2.0.2 libs

     
  • Scott Stirling

    Scott Stirling - 2002-11-11

    Logged In: YES
    user_id=136722

    After seeing the pasted classpath formatting above, I figured I
    better just attach the file.

     
  • Scott Stirling

    Scott Stirling - 2002-11-11

    Logged In: YES
    user_id=136722

    Sorry, last thing -- I should have said:

    To fix this I added <import plugin="org.apache.xerces"/>
    to the <requires> element of the plugin.xml

     
  • Roscoe Rush

    Roscoe Rush - 2002-11-26
    • status: open --> closed-fixed
     
  • Roscoe Rush

    Roscoe Rush - 2002-11-26

    Logged In: YES
    user_id=398209

    Added import statement to Release 2.2.9

     

Log in to post a comment.

MongoDB Logo MongoDB