Καλησπέρα,
είπα να στείλω εδώ, μήπως μπορεί να βοηθήσει κάποιος...Λοιπόν, χειρίζομαι το πρόγραμμα Sweethome3d
http://www.sweethome3d.com/index.jspτου οποίου τον κώδικα έχω αλλάξει μέσω του eclpse. Στην συνέχεια, προσπαθώ να το κάνω ένα jar αρχείο, το οποίο όμως μου βγάζει κάποια προβλήματα καθώς δεν περνάνε τα vm arguments που πρέπει να προσθέσω. Παρακάτω μπορεί να δει κανείς τι ακριβώς έχω κάνει...
Για να λειτουργήσει όταν το τρέχεις, πρέπει να προσθέσεις κάποια vm arguments, σύμφωνα με αυτό:
You may execute applications and tests of this archive, with the Eclipse Run menu.
To execute applications and tests that require Java 3D, open Run Dialog in Eclipse,
select the Arguments tab of the target application, and add to the VM arguments
text field the option
-Djava.ext.dirs=lib;lib/windows/i386,
-Djava.ext.dirs=lib;lib/windows/x64,
-Djava.ext.dirs=lib:lib/macosx,
-Djava.ext.dirs=lib:lib/linux/i386
or -Djava.ext.dirs=lib:lib/linux/x64
according to your system and its architecture.
Αλλά, δεν μπορώ να βρω πως γίνεται να περάσεις αυτά τα vm arguments (μου λέει βέβαια ότι " VM arguments will not be part of the runnable JAR. Arguments can be passed on the command line when launching the JAR", όταν το κάνω export σε runnable jar).
Έτσι, εγώ τα περνάω με το "java -jar SH3D.jar -Djava.ext.dirs=lib:lib/macosx", στο terminal. Αλλά, μου βγάζει errors
Exception in thread "main" java.lang.SecurityException: sealing violation: package javax.media.j3d is sealed
at java.net.URLClassLoader.defineClass(URLClassLoader.java:234)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.eteks.sweethome3d.j3d.Component3DManager.setR
enderingErrorObserver(Component3DManager.java:104)
at com.eteks.sweethome3d.SweetHome3D.addComponent3DR
enderingErrorObserver(SweetHome3D.java:491)
at com.eteks.sweethome3d.SweetHome3D.init(SweetHome3D.java:383)
at com.eteks.sweethome3d.Blender.main(Blender.java:181)
Οπότε ένα παιδί στο forum του SH3D μου είπε τα εξής:
There's no reason your Jar executable shouldn't work, If you try to build it the same way I used for Sweet Home 3D, meaning:
- Use a main class similar to com.eteks.sweethome3d.SweetHome3DBootstrap, where you'll store in applicationClassName variable the name of your own main class, and add to applicationPackages array your own packages if you created some. The class loader used by this special main class extracts all the DLLs and JARs required by the project from the running Jar executable file, and stores them in temporary files referenced during the execution of the application (quickly said it conveniently replaces the java.ext.dirs property).
- Build the Jar executable with a Ant task that gathers project class files, resources files, jar libraries and Java 3D DLLs.
Οπότε και εγώ έκανα τα εξής:
1. Terminal (όπως μου λέει στο Readme.txt
If you want to build Sweet Home 3D with Ant, please install last JDK 5 or 6 and
Ant available at
http://ant.apache.org/, and run ant command in the directory where
you uncompressed this archive.
The default target provided by build.xml Ant file builds the Java Web Start version.
Read build.xml Ant file for more information about other available targets.
Note that the last part of the Ant targets javaWebStart, applet and viewer
requires a passphrase for keystore to sign the deployed jars. For security reasons,
the required file keys.keytool isn't provided with this source code. You'll have
first to generate this file and choose a passphrase, with the following command run
in the directory where you uncompressed this archive:
keytool -genkey -keystore keys.keytool -alias SweetHome3D
)
Workspace-> Sweethome3d-3.3
- keytool -genkey -keystore keys.keytool -alias SweetHome3D
Password: xxxxx
2. Eclipse
Επιλέγω το project μου.
Run -> External Tools -> External Tools Configuration -> ant build
Επιλέγω το build.xml
Και μου κάνει build (εδώ βάζω και τον κωδικό)
Μετά κάνω Export-> Runnable Jar -> with ant
Αλλά πάλι δεν μου το κάνει σωστά.
Έχει κάποιο τι άλλο θα μπορούσα να δοκιμάσω για να τρέξει?
Εκπέμπω SOS:)