Re: How to load "foreign" jars from a Plugin?

by clanmills » Tue Mar 03, 2015 2:50 pm

Emmanuel

You are 100% correct. A big round of applause for M Puybaret.

When I merge the jars, everything works. I've added a script 'build' to the plugins directory. I'll figure the Ant/Eclipse/export later.

Code: Select all

885 rmills@rmillsmbp:~/Library/Application Support/eTeks/Sweet Home 3D/plugins $ dir
-rw-r--r--+ 1 rmills  staff   131K  3 Mar 13:49 ToWebPlugin.jar
-rwxr-xr-x@ 1 rmills  staff   348B  3 Mar 13:48 build*
-rw-r--r--+ 1 rmills  staff   312K  2 Mar 13:28 ST-4.0.8.jar
-rw-r--r--@ 1 rmills  staff    23K  2 Mar 13:28 json-simple-1.1.1.jar
886 rmills@rmillsmbp:~/Library/Application Support/eTeks/Sweet Home 3D/plugins $ ./build
-rw-r--r--+ 1 rmills  staff  133765  3 Mar 13:49 ToWebPlugin.jar
-rw-r--r--+ 1 rmills  staff  399906  3 Mar 13:50 ToWebPlugin.jar
887 rmills@rmillsmbp:~/Library/Application Support/eTeks/Sweet Home 3D/plugins $

Code: Select all

#!/bin/bash

##
# build ToWebPlugin.jar
##

# static data
foo=foo
jar=ToWebPlugin.jar

if [ -e "$jar" ]; then
	ls -alt "$jar"
	rm -rf  "$foo"
	mkdir   "$foo"
	for i in *.jar ; do (
	 	cd "$foo"
	 	jar xf ../$i
	) 	done
	cd  $foo
	jar cf  "../$jar" *
	cd  ..
	rm -rf  "$foo"
	ls -alt "$jar"
else
	echo "file $jar does not exist"
fi

# That's all Folks!
##
Thank You very much indeed for your help. Merci Beaucoup!