Login  Register

Re: Java 3D in eclipse Mac OSX not functioning

Posted by gouessej on Feb 02, 2015; 2:15pm
URL: https://forum.jogamp.org/Java-3D-in-eclipse-Mac-OSX-not-functioning-tp4033010p4033979.html

Hi

everythingConnected wrote
Thanks for your help once again.
You're welcome.

everythingConnected wrote
Have just been googling the manifest option and impacts on classpath and becoming slightly confused. Could you send me a link to the paragraph you mention please?
http://www.manpagez.com/man/1/java/
When you use this option, the JAR file is the source of all user classes, and other user class path settings are ignored.
This webpage indicates how to add files to the JAR's classpath (by modifying the manifest attribute "Class-Path"):
http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html

I don't want to be harsh but I advise you to read correctly the documentation of the commands that you want to use.

everythingConnected wrote
Just so you know what I am doing in case I am making other mistakes. I have a jar created in eclipse on a PC. The manifest file simply says:

Manifest-Version: 1.0
Main-Class: main.MyDriver
SplashScreen-Image: images/splash.jpg

This works fine on a PC, and simply needs to run on a Mac. Other Java (non Java3D) programs I have run fine on a mac by simply double clicking the relevant jar file. However this doesnt work in Java3D on a Mac. All I want to do is to get my Jar to run on my friends Mac - ideally via a double click. Will this be possible with the current Java3D / Mac OS systems?
At first, I advise you to use Ant in Eclipse to create your JAR as it's safer and it gives you a lot of control on the creation. Using Eclipse as a black box without trying to understand what happens inside will lead you nowhere except for extremely simple applications with no external dependencies.

Secondly, you're probably doing something else wrong, it shouldn't find magically your libraries even on a PC. You should read this section of my article even though it has been written for another engine, most of it still applies for Java3D:
https://gouessej.wordpress.com/2014/11/22/ardor3d-est-mort-vive-jogamps-ardor3d-continuation-ardor3d-is-dead-long-life-to-jogamps-ardor3d-continuation/#deployment
The paragraph entitled "Executable JAR" lists tons of limitations that you seem to ignore.

everythingConnected wrote
When you say 'update the classpath attribute of the manifest' could you give me a tip please. And surely if I affected the classpath via the manifest file this would have an impact on the jar files portability?
Clean up your PC and you will exhibit mostly the same behaviour than on a Mac. Look at my answer above, especially the second link I gave you.

everythingConnected wrote
Dont worry, your blog instructions are the clearest information I have found and are much appreciated. There is a lot of conflicting advice out there, due to the various versions that have been run of Java3D over the years. As said, I have been through the Mac and cleared all the dirty installs I have put in, to the best of my knowledge. I have been using Java3D for nearly 10 years and so unfortunately the old ways of installing the various old versions have become common, and were the first things I tried due to habit with PC's. They also work fine on a PC, and I am not a normal Mac user, and having spent far too much of my time on this problem already am unlikely to become one:-)
There are lots of confusing instructions due to the stupidity and the selfishness of some bloggers who are more interested in earning money from ads than providing accurate and updated information. In some cases, some developers have bad habit and/or take themselves for experts. I fear that you "installed" Java3D somewhere on your PC and it is picked up, it won't work on some other PCs. I'm still open to suggestions, nothing is perfect.

Keep in mind that as the public API of Java3D is frozen, there will ever be some machines on which it won't work because of unresolvable conflicts when you use the JVM installed on the system. What you did on a single Mac shouldn't or can't be done on all Macs of your end users. There are some tricks to work around this limitation, for example Runiter explained how to rename the packages of Java3D so that OS X never makes a confusion between the obsolete version of Java3D and the latest one.

Finally, you probably want to create a single JAR containing both your application and its dependencies as you talked about running it by a double click. It's explained in the very last link I gave you. OS X itself will annoy you, I mean that Gatekeeper might block your application, I had to update my instructions about this concern:
http://tuer.sourceforge.net/en/play/
Julien Gouesse | Personal blog | Website