France
Joined: Nov 7, 2005
Post Count: 9141
Status:
Offline
Re: Running Jar File in Mac
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.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
Joined: Jul 26, 2011
Post Count: 62
Status:
Offline
Re: Running Jar File in Mac
Hello!!
This is a rather old thread, but it is the last remaining step for my thesis! (finally). Actually, my partner in thesis had solved this problem, but we can't remember how we did it.
Following your last advice, we tried to do it by using ant, meaning:
1. Like it is said in the README.txt we did
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
2. So I went to workspace/Sweethome3d-src and I entered the above line, where I put my password and some other required stuff.
3. Then, through eclipse, I went to run->external tools-> external tools configuration -> ant build, where I added the vm arguments and I located the build.xml file that was required
4. I run this ant build, where I put the password and the displayed message was "BUILD SUCCESSFUL"
5. Then I tried to export the file as runnable jar using the option "With ant" and I exported it.
6. Finally I tried, by using the terminal, to open my jar file, but no luck...
Please, it is a matter of physical health, right now. I need to fix this! Help me! Mitsaki
France
Joined: Nov 7, 2005
Post Count: 9141
Status:
Offline
Re: Running Jar File in Mac
I don't understand why speak about building the Java Web Start version, in a subject named "Running Jar File in Mac". Did I miss something or did you forget to read again my previous message about jarExecutable Ant target?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
Joined: Jul 26, 2011
Post Count: 62
Status:
Offline
Re: Running Jar File in Mac
I guess that I shouldn't have done steps 1 and 2 in order to do that:
Build the Jar executable with a Ant task that gathers project class files, resources files, jar libraries and Java 3D DLLs.
I should do
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.
France
Joined: Nov 7, 2005
Post Count: 9141
Status:
Offline
Re: Running Jar File in Mac
Yes steps 1 and 2 are useless to generate an executable file.
In Eclipse, simply check jarExecutable target in the Targets tab of the External Tools Configuration dialog box.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
UK
Joined: Aug 26, 2013
Post Count: 1
Status:
Offline
Re: Running Jar File in Mac
I encountered the same "sealing violation" problem when running in the Eclipse IDE via SweetHome3D.main. Building a JAR worked fine but it is nice to be able to skip that step. The post at [1] suggests that the sealing violation error is due to the version of Java3D installed on my system (OS X Mountain Lion). The solution at that post (the installer at [2]) worked for me and I can now run smoothly from the IDE with no special config.