Advertisement

03.05.2008 at 02:22PM PST, ID: 23217766
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Running Eclipse Project as an Executable Jar

Tags: Java, Eclipse
I am looking for some help in getting my eclipse project to run as an executable jar.  The problem is that the aforementioned project has many other jar and file dependencies which I don't know how to set up via the command line.  Eclipse lets me export my project as an executable jar, but I can't seem to get it to work.  I keep getting ClassNotFoundErrors.  

Does anyone have any tips for how to do this with the least amount of pain?  I was thinking I could maybe write a batch file since I'm guessing that the command is going to get pretty long.  It's been awhile since I have run anything via the command line though, so examples would be very helpful.

In the end I just need to get my command line-based application to run.  It works in the Eclipse ide, but I need it to run standalone.  Thanks in advance for any and all help.

--Charly
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
Here is what I have tried so far:
 
C:\temp
   myJar.jar
   config.xml
C:\temp\lib
        required jar files
        required dll
C:\temp\resources
        log4j.properties
        config.xsd
C:\temp\resources\package...
                  resource.properties
 
Command Line Arguments
c:\java -classpath C:\temp;C:\temp\lib;C:\temp\resources -jar myJar.jar
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: dleehanson
Solution Provided By: CEHJ
Participating Experts: 1
Solution Grade: A
Views: 159
Translate:
Loading Advertisement...
03.05.2008 at 02:25PM PST, ID: 21055289

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.05.2008 at 02:27PM PST, ID: 21055301

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 07:28AM PST, ID: 21061062

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 07:32AM PST, ID: 21061116

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 08:36AM PST, ID: 21062005

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 08:41AM PST, ID: 21062066

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 08:45AM PST, ID: 21062127

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 08:47AM PST, ID: 21062144

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 09:11AM PST, ID: 21062442

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 09:15AM PST, ID: 21062495

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 09:51AM PST, ID: 21062887

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 09:57AM PST, ID: 21062951

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 11:08AM PST, ID: 21063602

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 11:21AM PST, ID: 21063731

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 11:38AM PST, ID: 21063874

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 11:48AM PST, ID: 21063998

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 11:53AM PST, ID: 21064047

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 12:02PM PST, ID: 21064121

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 12:20PM PST, ID: 21064276

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 12:35PM PST, ID: 21064444

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 01:30PM PST, ID: 21064984

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 01:32PM PST, ID: 21064997

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 01:38PM PST, ID: 21065050

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 01:41PM PST, ID: 21065087

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 01:55PM PST, ID: 21065204

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 01:59PM PST, ID: 21065232

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 02:00PM PST, ID: 21065245

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 02:16PM PST, ID: 21065363

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.06.2008 at 02:24PM PST, ID: 21065417

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
03.05.2008 at 02:25PM PST, ID: 21055289

Rank: Genius

Please post the errors you're gettings
 
03.05.2008 at 02:27PM PST, ID: 21055301

Rank: Genius

Oh and can you extract the manifest from the main jar and post it here
 
03.06.2008 at 07:28AM PST, ID: 21061062
I'm guessing that the problem is with my manifest file.  What all has to be in there?

Thanks for the help.

--Charly
       
1:
2:
3:
4:
5:
6:
When I try and run the jar with the above cmd I get:
Exception in thread "main" java.lang.NoClassDefFoundError:javafish/clients/opc/exception/CoInitializeException
 
My manifest file is just this:
Manifest-Version: 1.0
Main-Class: com.pcielectric.amc.AMCLabelServer
Open in New Window
 
03.06.2008 at 07:32AM PST, ID: 21061116
Here is my .classpath contents as well.  Is this an Eclipse-only thing, or is this used by the jar?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry excluding="com/pcielectric/amc/label/AMCLabelServerWithXML.java|com/pcielectric/amc/ServerThread.java" kind="src" path="src"/>
	<classpathentry excluding="com/pcielectric/amc/AMCProductionLineTest.java|com/pcielectric/amc/ServerThreadTest.java" kind="src" path="test"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="lib" path="lib/commons-logging-1.1.jar"/>
	<classpathentry kind="lib" path="lib/jdom.jar"/>
	<classpathentry kind="lib" path="lib/log4j-1.2.15.jar"/>
	<classpathentry kind="lib" path="resources"/>
	<classpathentry kind="lib" path="lib/filemonitor.jar"/>
	<classpathentry kind="lib" path="lib/jeasyopc.jar"/>
	<classpathentry kind="output" path="bin"/>
</classpath>
Open in New Window
 
03.06.2008 at 08:36AM PST, ID: 21062005

Rank: Genius

There should be a

Class-Path: lib/jdom.jar lib/filemonitor.jar .............

entry in the manifest with all the paths in. Note the separators are spaces
 
03.06.2008 at 08:41AM PST, ID: 21062066
I'm heading down the jar trail atm so I can ask more intelligent questions.  I've never made jars or worked with their manifests...
 
03.06.2008 at 08:45AM PST, ID: 21062127

Rank: Genius

I know Eclipse doesn't integrate very well with Ant, but i would have thought it could make a better job of exporting it. Are you sure you're doing it right?
 
03.06.2008 at 08:47AM PST, ID: 21062144

Rank: Genius

Actually, having said that about Ant, it might not even be using it, so don't take that bit too seriously ;-)
 
03.06.2008 at 09:11AM PST, ID: 21062442
No, I'm not sure I'm doing it right... :(

I have heard of Ant, but I'm not really familiar with what it does.  Is it something along the lines of what I am trying to do?

It looks like it is installed in my Eclipse install, but I'm not using it.
 
03.06.2008 at 09:15AM PST, ID: 21062495
I tried exporting my project using Ant, and this is what I got.  I'm not sure what to do with it now though to create my executable jar file...
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
              Any modifications will be overwritten.
              To include a user specific buildfile here, simply create one in the same
              directory with the processing instruction <?eclipse.ant.import?>
              as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="AMCLabeler">
    <property environment="env"/>
    <property name="ECLIPSE_HOME" value="../../target/eclipse"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.6"/>
    <property name="source" value="1.6"/>
    <path id="AMCLabeler.classpath">
        <pathelement location="bin"/>
        <pathelement location="lib/commons-logging-1.1.jar"/>
        <pathelement location="lib/jdom.jar"/>
        <pathelement location="lib/log4j-1.2.15.jar"/>
        <pathelement location="resources"/>
        <pathelement location="lib/filemonitor.jar"/>
        <pathelement location="lib/jeasyopc.jar"/>
    </path>
    <target name="init">
        <mkdir dir="bin"/>
        <copy includeemptydirs="false" todir="bin">
            <fileset dir="src" excludes="**/*.launch, **/*.java"/>
        </copy>
    </target>
    <target name="clean">
        <delete dir="bin"/>
    </target>
    <target depends="clean" name="cleanall"/>
    <target depends="build-subprojects,build-project" name="build"/>
    <target name="build-subprojects"/>
    <target depends="init" name="build-project">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
            <src path="src"/>
            <exclude name="com/pcielectric/amc/label/AMCLabelServerWithXML.java"/>
            <exclude name="com/pcielectric/amc/ServerThread.java"/>
            <classpath refid="AMCLabeler.classpath"/>
        </javac>
    </target>
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
    <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
        <copy todir="${ant.library.dir}">
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </copy>
        <unzip dest="${ant.library.dir}">
            <patternset includes="jdtCompilerAdapter.jar"/>
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </unzip>
    </target>
    <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
        <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
        <antcall target="build"/>
    </target>
    <target name="AMCApplicatorTest">
        <java classname="AMCApplicatorTest" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="AMCLabelServer">
        <java classname="com.pcielectric.amc.AMCLabelServer" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="AMCLabelServerWithXML">
        <java classname="com.pcielectric.amc.label.AMCLabelServerWithXML" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="AMCLabelTest">
        <java classname="com.pcielectric.amc.AMCLabelTest" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="AMCOrderTest">
        <java classname="com.pcielectric.amc.AMCOrderTest" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="AMCPalletTest">
        <java classname="com.pcielectric.amc.AMCPalletTest" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="AMCXMLTest">
        <java classname="com.pcielectric.learning.AMCXMLTest" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="DateFormatTest">
        <java classname="com.pcielectric.learning.DateFormatTest" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="FileManipTest">
        <java classname="com.pcielectric.learning.FileManipTest" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="FormatTest">
        <java classname="com.pcielectric.learning.FormatTest" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="JDomTest">
        <java classname="com.pcielectric.learning.JDomTest" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="MorePrinting">
        <java classname="com.pcielectric.learning.MorePrinting" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="OPCTest">
        <java classname="com.pcielectric.learning.OPCTest" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="PrintingTest">
        <java classname="com.pcielectric.learning.PrintingTest" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="ServerThreadTest">
        <java classname="com.pcielectric.amc.ServerThreadTest" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="XMLTesting">
        <java classname="com.pcielectric.learning.XMLTesting" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
    <target name="ZebraPrinterTest">
        <java classname="com.pcielectric.amc.ZebraPrinterTest" failonerror="true" fork="yes">
            <classpath refid="AMCLabeler.classpath"/>
        </java>
    </target>
</project>
Open in New Window
 
03.06.2008 at 09:51AM PST, ID: 21062887

Rank: Genius

Wow - more targets than at an international archery convention. Luckily you can use the default. Change to the directory in which the file build.xml resides and do

ant

at the command line
 
03.06.2008 at 09:57AM PST, ID: 21062951

Rank: Genius

Hang on - there aren't *enough* targets. There's no distribution target. You haven't selected the right options for an executable jar (if they exist). When you have, you should be able to search on

<jar

in there and find something. Keep trying ..
 
03.06.2008 at 11:08AM PST, ID: 21063602
I think I am running into too many options.  While Ant looks cool, I think I was close to getting it to work with my new manifest file I was working with.  Or do you think that Ant is just going to be better and I should abandon this route?

After adding the classpaths, I got a new error.  I think the DataConversionException is from the jar not being able to find my labelerConfig.xml file which is outside of the jar.  I need it to be outside the jar since the user needs to change it from time to time.  Do you know how to reference a file outside of the jar?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
C:\Documents and Settings\Charly\Desktop>java -jar amc.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/jdom/DataConversi
onException
Caused by: java.lang.ClassNotFoundException: org.jdom.DataConversionException
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Open in New Window
 
03.06.2008 at 11:21AM PST, ID: 21063731

Rank: Genius

The jdom jar is not in the classpath. Again, if you post the manifest of amc.jar here, it will help. But you're getting somewhere ...
 
03.06.2008 at 11:38AM PST, ID: 21063874
I thought I had the jdom.jar listed in there...  They are space separated right?  It's not liking the filename for some reason, but I just checked and the name is right.  Can you see anything that I'm doing wrong?  When I entered it in I had it all on one line since I didn't know how to do line continuation.  It looks like it bumped it down to the next line for me.
1:
2:
3:
4:
5:
Manifest-Version: 1.0
Class-Path: lib/commons-logging-1.1.jar lib/jdom.jar lib/log4j-1.2.15.
 jar lib/filemonitor.jar lib/jeasyopc.jar javafish/clients/opc javafis
 h/clients/opc/lang ./ 
Main-Class: com.pcielectric.amc.AMCLabelServer
Open in New Window
 
03.06.2008 at 11:48AM PST, ID: 21063998

Rank: Genius



jdom.jar must be in a lib directory, sitting below where your executable jar is located. Is it?
 
03.06.2008 at 11:53AM PST, ID: 21064047
Are you talking outside the jar or inside it?  I have a directory called lib inside the jar containing all the jars I need.  Or does it have to be outside of it?
 
03.06.2008 at 12:02PM PST, ID: 21064121

Rank: Genius

Yes it has to be outside of it. Jars can't be nested
 
03.06.2008 at 12:20PM PST, ID: 21064276