Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 17
Posts: 17   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 10752 times and has 16 replies Next Thread
Mitsaki
Member




Joined: Jul 26, 2011
Post Count: 62
Status: Offline
Reply to this Post  Reply with Quote 
confused Running Jar File in Mac

Hello,

I have changed the code of Sweethome3d in order to create my own application and I have created an executable jar file. I would like to run it from command line, but for some strange reason it does not.

I use this command in terminal
java -jar Blender.jar -Djava.ext.dirs=lib:lib/macosx

but it gives me this mistake

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.setRenderingErrorObserver(Component3DManager.java:104)
at com.eteks.sweethome3d.SweetHome3D.addComponent3DRenderingErrorObserver(SweetHome3D.java:491)
at com.eteks.sweethome3d.SweetHome3D.init(SweetHome3D.java:383)
at com.eteks.sweethome3d.Blender.main(Blender.java:181)

What I have also done is change the MANIFEST.MF in order to have my main class as the main class of the program. Is that wrong?

Manifest-Version: 1.0
Created-By: 1.5 (Sun Microsystems, Inc)
Main-Class: com.eteks.sweethome3d.Blender

Could you tell me if you have any idea what I am doing wrong?
[Sep 13, 2011, 6:42:21 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Mitsaki
Member




Joined: Jul 26, 2011
Post Count: 62
Status: Offline
Reply to this Post  Reply with Quote 
Re: Running Jar File in Mac

Well, even if I don't change the manifest, it still doesn't run.
[Sep 13, 2011, 7:02:49 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Mitsaki
Member




Joined: Jul 26, 2011
Post Count: 62
Status: Offline
Reply to this Post  Reply with Quote 
Re: Running Jar File in Mac

Even with this: java -jar Blender.jar -vmargs Djava.ext.dirs=lib:lib/macosx
[Sep 13, 2011, 8:28:19 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: Running Jar File in Mac

I use this command in terminal
java -jar Blender.jar -Djava.ext.dirs=lib:lib/macosx
In what folder did you run this command?
Did you try with absolute paths instead of relative paths "lib" and "lib/macox"?
Even with this: java -jar Blender.jar -vmargs Djava.ext.dirs=lib:lib/macosx
-vmargs isn't a java command option!

Your problem is due to the fact that the JVM doesn't find the Java 3D libs in the extension folders you specified, so it uses the default old ones in the system found in /System/Library/Java/Extensions/. The easiest way to check this is to temporarily remove the j3d*.jar files from this folder, then when you run again your java command, you'll get a NoClassDefFoundError exception about a Java 3D class.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Sep 14, 2011, 7:44:21 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Mitsaki
Member




Joined: Jul 26, 2011
Post Count: 62
Status: Offline
Reply to this Post  Reply with Quote 
Re: Running Jar File in Mac

I have placed my Blender.jar file in a folder in my desktop. First I open the folder using the cd command, and then I run the jar file. But it seems not to recognize the VM arguments.

You are right about -vmargs, but I was reading a forum and I got confused. I removed temporarily the jar files from this folder as you said, and I got the message.

Now, I tried to run the SweetHome3D-3.3.jar file and it runs perfectly from command line using the command as before.

I will try with absolute paths, and I will tell you the result.
[Sep 14, 2011, 10:19:24 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: Running Jar File in Mac

I tried to run the SweetHome3D-3.3.jar file and it runs perfectly from command line using the command as before.
It even runs without the -Djava.ext.dirs option. wink
If you want to make your program work as SweetHome3D Jar executable, study how it is built with jarExecutable Ant target.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Sep 14, 2011, 12:06:17 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Mitsaki
Member




Joined: Jul 26, 2011
Post Count: 62
Status: Offline
Reply to this Post  Reply with Quote 
Re: Running Jar File in Mac

Thanks for the advice.
[Sep 14, 2011, 12:14:51 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Mitsaki
Member




Joined: Jul 26, 2011
Post Count: 62
Status: Offline
Reply to this Post  Reply with Quote 
Re: Running Jar File in Mac

Well, I tried to do it with absolute paths, but no luck. I cannot understand.
[Sep 14, 2011, 2:11:01 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Mitsaki
Member




Joined: Jul 26, 2011
Post Count: 62
Status: Offline
Reply to this Post  Reply with Quote 
Re: Running Jar File in Mac

Well, I used the absolute paths in order to show in the Sweethome3d source code right? lib: /Users/dimitramicha/Documents/workspace/SweetHome3D-3.3-src/lib
and lib/macosx: /Users/dimitramicha/Documents/workspace/SweetHome3D-3.3-src/lib/macosx
which are in the workspace.
Which main should I keep? I kept as run configurations the ones that I use to execute the program right? I really am very confused.
[Sep 14, 2011, 2:37:27 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Mitsaki
Member




Joined: Jul 26, 2011
Post Count: 62
Status: Offline
Reply to this Post  Reply with Quote 
Re: Running Jar File in Mac

I also try to do it with the existing source code, in order to see if I have some mistakes in my code, but the jar file that I export, does not run.
[Sep 14, 2011, 4:45:34 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 17   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved