java - JAR classpath and external jars -
i actualy have 2 problems
i use eclipse -> export project generate jar file simple desktop (gui) program
generates jar file , ant script.
first problem: generated jar works fine when double-clicked.
when use generated ant script generate jar
myself, doesn't work. can wrong target (assuming dependencies met)
<target name="create_run_jar"> <jar destfile="g:/dev/myproj/myproj.jar"> <manifest> <attribute name="main-class" value="view.myproj"/> <attribute name="class-path" value=". myproj_lib/grouplayout.jar"/> </manifest> <fileset dir="g:/dev/myproj/bin"/> </jar> <delete dir="g:/dev/myproj/myproj_lib"/> <mkdir dir="g:/dev/myproj/myproj_lib"/> <copy file="g:/dev/.metadata/.plugins/org.dyno.visual.swing/layoutext/grouplayout.jar" todir="g:/dev/myproj/myproj"/> </target>
//nevemind
//second problem:
//when double click on auto-generated jar file program launches , works fine.
//when java myjar command-line main class not found exception..
//weird huh?
i suggest take jar files generated 2 ways, use jar
command expand them temporary directories, , use diff
in recursive mode compare them.
however, suspect @pace has put finger on problem; i.e. using relative paths in class-path
manifest entry , liable cause problems.
Comments
Post a Comment