Support
Quality
Security
License
Reuse
kandi has reviewed JarBundler and discovered the below as its top functions. This is intended to give you an instant insight into JarBundler implemented functionality, and help decide if they suit your requirements.
Get all kandi verified functions for this library.
Get all kandi verified functions for this library.
Massive code refactoring code formatting specify maven source encoding fix Ant build files run examples with a modern JavaApplicationStub (universalJavaApplicationStub)
Updates to docs and examples
Optional supportsAutomaticGraphicsSwitching attribute which defaults to true (for Plist key NSSupportsAutomaticGraphicsSwitching) PullRequest !14, thanks to Björn Kautler (@Vampire) for his contribution!
Update Ant from 1.9.3 to 1.9.14
Bugfix: JarBundler on Windows created a classpath with backward slashes which broke the Info.plist file on macOS \ in classpath are now replaced with /
Remove support for Java 1.3 if no jvmversion attribute is set, the default version is now 1.4+ removed deprecated growboxintrudes attribute removed deprecated liveresize attribute removed deprecated smalltabs attribute
Updated HelloWorld example to show JVM details, classpath and mainArgs
Support for Java 9+ in jvmversion attribute
See all related Code Snippets
QUESTION
Using Jarbundler with ant
Asked 2017-Jul-18 at 08:07Im trying to use a jarbundler to create a .app file with ant. But I'm getting the following error:
taskdef class net.sourceforge.jarbundler.JarBundler cannot be found using the classloader AntClassLoader[/Users/Ida/NetBeansProjects/supernova/build/classes/lib/jarbundler-core-3.3.0.jar]
My build.xml looks like this:
<path id="classpath">
<fileset dir="dist/lib">
<include name="*.jar"/>
</fileset>
</path>
<target name="clean">
<delete dir="build"/>
</target>
<target name="compile">
<mkdir dir="build/classes"/>
<javac srcdir="src" destdir="build/classes">
<classpath>
<path refid="classpath"/>
<path location="${jar.dir}/${ant.project.name}.jar"/>
</classpath>
</javac>
<copy todir="build/classes">
<fileset dir="src" excludes="**/*.java"/>
</copy>
</target>
<target name="dist">
<mkdir dir="build/classes/lib"/>
<copy flatten="true" todir="build/classes/lib" includeemptydirs="false">
<fileset dir="dist/lib">
<include name="*.jar"/>
</fileset>
</copy>
<mkdir dir="build/jar"/>
<jar destfile="build/jar/SuperNova.jar" basedir="build/classes">
<fileset dir="dist/lib">
<include name="*.jar"/>
</fileset>
<manifest>
<attribute name="Main-Class" value="com.lumenradio.supernova.SuperNovaApp"/>
</manifest>
</jar>
</target>
<target name="jar">
<mkdir dir="build/jar"/>
<jar destfile="build/jar/SuperNova.jar" basedir="build/classes">
<fileset dir="dist/lib">
<include name="*.jar"/>
</fileset>
<manifest>
<attribute name="Main-Class" value="com.lumenradio.supernova.SuperNovaApp"/>
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java fork="true" classname="com.lumenradio.supernova.SuperNovaApp">
<classpath>
<path refid="classpath"/>
<path location="build/jar/SuperNova.jar"/>
</classpath>
</java>
</target>
<target name='package-app'>
<taskdef name="jarbundler" classname="net.sourceforge.jarbundler.JarBundler">
<classpath>
<pathelement location="build/classes/lib/jarbundler-core-3.3.0.jar"/>
</classpath>
</taskdef>
<jarbundler dir="dist" name="SuperNova"
mainclass="com.lumenradio.supernova.SuperNovaApp"
jar="build/jar/SuperNova.jar"/>
</target>
Does anybody now why I'm getting this error and how I should solve it?
EDIT
Thanks for your help. I can now build the .app file but when I'm trying to run it I get the following error:
Error: Could not find or load main class com.lumenradio.supernova.SuperNovaApp
My target now looks like this:
<target name='package-app'>
<taskdef name="jarbundler" classpath="build/classes/lib/jarbundler-core-3.3.0.jar"
classname="com.ultramixer.jarbundler.JarBundler"/>
<jarbundler dir="dist" name="SuperNova"
jar="build/jar/SuperNova.jar"
mainclass="com.lumenradio.supernova.SuperNovaApp"
icon="SuperNova copy.icns"
stubfile="universalJavaApplicationStub"
useJavaXKey="true"
jvmversion="1.7+"/>
</target>
ANSWER
Answered 2017-Jul-13 at 18:26I downloaded the jar to take a look, and I think the issue is that your classname
is wrong. The JarBundler class is located in com.ultramixer.jarbundler.JarBundler
, so try this instead:
<taskdef name="jarbundler" classname="com.ultramixer.jarbundler.JarBundler">
<classpath>
<pathelement location="build/classes/lib/jarbundler-core-3.3.0.jar"/>
</classpath>
</taskdef>
Also, since you're only loading a single library, there's no need use a nested classpath instead of taskdef
's classpath
attribute, so you can simplify it somewhat:
<taskdef
name="jarbundler"
classname="com.ultramixer.jarbundler.JarBundler"
classpath="build/classes/lib/jarbundler-core-3.3.0.jar"
/>
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Find more information at:
Save this library and start creating your kit
See Similar Libraries in
Save this library and start creating your kit
Open Weaver – Develop Applications Faster with Open Source