Deployment jme using Netbeans

I have created a simple game using jme on Netbeans which is running and working very good on my IDE. Now Im having a hard time trying to send it to other users. I would like to show my game to other people. So I've read information about packing and deploying like the jme_webstart_step_by_step but It's not working for me. I am having too many problems with the command line instructions like:



C:jME2jME2lib>jar cvf windows-native.jar *.dll

'jar' is not recognized as an internal or external command,

operable program or batch file.



C:jME2jME2lib>



The same happens when I type keytool -genkey -alias key_name



  I would like to distribute my project and be able to open it by clicking on the .jar file as i do with my regular (not jme projects) I tried to build my project and I got this message:

deps-jar:

compile:

C:Documents and SettingsOwner.GabyMy DocumentsjME2jMEbuild is a directory or can't be read. Not copying the libraries.

Not copying the libraries.

To run this application from the command line without Ant, try:

java -jar "C:Documents and SettingsOwner.GabyMy DocumentsNASAThinkSpacedistThinkSpace.jar"

jnlp:

jar:

BUILD SUCCESSFUL (total time: 1 seconds)



It isn't copying the libraries somehow. When I try to open the jar file I get this message:



( Could not find the main class. The Project will exit. )



Even though I have assigned the main class already.



Im having almost the same unresolved deploying problem as this guy:  http://www.jmonkeyengine.com/jmeforum/index.php?topic=8729.0



I will appreciate any help. Hope someone can help this time. Thank You very much!



I will try to use JSmooth to distribute. Perhaps, it could be easier. 








The latest NetBeans (6.5) supports WebStart deployment which automatically signs your jars. Since Java6 you can deploy applets using webstart so you might want to consider that option.

'jar' is not recognized as an internal or external command,

Either you have not installed a JDK or your your JDK/bin folder is not in your Path environment variable.

NetBeans won't include a bunch of classes (which is all its seeing under the build folder).  This is due to including the jME library (or project) directly, solution is to include jar files only.



Options:


  • Download the "Distribution" jars http://code.google.com/p/jmonkeyengine/downloads/list

  • Create your own jME Jar (or use the Complete one from the above link)

  • Point your project to the jME output jars under '/target' (you will need to run ant command "dist-all")


Each of these options require you to include the chosen jar files under the libraries option of the project properties.

Well… I have figured some things out. I have created my native jars. created the key, I have signed all the jars and created de jnlp. Although, I dont know if I wrote everything in the jnlp file right. Now the jnlp won't open. It's has been a pain!!! I thought it would be easy to deploy a jme and hard to Install and run. Turns out It's really cumbersome to pack and deploy a simple jme application. Netbeans is not helping either.



I was able to build my project creating another jME2-Compile including the jme_2.0.jar path into it. Now I got the distlib folder with all the necessary jars for my project. But I still can't open MyGAME.jar



I just want to double-click on the jar and open my project as I always do and distribute it to other people. I dont have any webspace to post my webstart anyways. I will have to video record my game and send the preview  :(. That's all i can do by mow. Right now, I got a working project stuck in my IDE.  :?

I cannot build my project and still don't have the dist/lib folder because the jme2-compile library does not contain any jars but the classpath is set to the build directory, as it is in the tutorial.



I have read about some similar topics and noticed that I needed the necessary jars in the target folder.



Now that I've followed the steps and have the jars in the target folder how can I build my project?



I've tried to change my class path to the target directory but it doesn't  build either, Im still getting this:



"jME2jMEtarget  is a directory or can't be read. Not copying the libraries."



I will appreciate some help. thank you !  :smiley:

Don't point it to the target folder… include EACH jar file separately…

Thanks Basixs  :smiley: It worked fine. Now I can clean and compile the project without problems.



But now, when I tried to run the project from the command line I got this:



Apr 11, 2009 2:33:18 PM com.jme.app.BaseGame start

INFO: Application started.

Apr 11, 2009 2:33:18 PM com.jme.system.PropertiesGameSettings <init>

INFO: PropertiesGameSettings created

Apr 11, 2009 2:33:18 PM com.jme.system.PropertiesGameSettings load

WARNING: Could not load properties. Creating a new one.

Apr 11, 2009 2:33:18 PM class think.Lesson5 start()

SEVERE: Exception in game loop

java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

        at java.lang.ClassLoader.loadLibrary(Unknown Source)

        at java.lang.Runtime.loadLibrary0(Unknown Source)

        at java.lang.System.loadLibrary(Unknown Source)

        at org.lwjgl.Sys$1.run(Sys.java:72)

        at java.security.AccessController.doPrivileged(Native Method)

        at org.lwjgl.Sys.doLoadLibrary(Sys.java:65)

        at org.lwjgl.Sys.loadLibrary(Sys.java:81)

        at org.lwjgl.Sys.<clinit>(Sys.java:98)

        at org.lwjgl.opengl.Display.<clinit>(Display.java:129)

        at com.jme.system.lwjgl.LWJGLPropertiesDialog$ModesRetriever.run(LWJGLPr

opertiesDialog.java:682)

        at com.jme.app.AbstractGame.getAttributes(AbstractGame.java:252)

        at com.jme.app.BaseGame.start(BaseGame.java:67)

        at think.Lesson5.main(Lesson5.java:90)

Apr 11, 2009 2:33:18 PM com.jme.app.BaseGame start

INFO: Application ending.



Even though I typed this in the VM Options

-Djava.library.path="C:Documents and SettingsOwner.GabyMy DocumentsjME2jMEliblwjglnativewin32"



I think this is the reason why the jar file doesn't open by double-clicking on it. Can this be a problem that could affect the jnlp creation?



I will try to create the jnlp file from netbeans.

I just want to have a web-host to link my jnlp. I dont want any web page for now.



Is there any way to create just a link to my jnlp file ?



Thank you   :)

lgabriel28 said:

Thanks Basixs  :D It worked fine. Now I can clean and compile the project without problems.

But now, when I tried to run the project from the command line I got this:
...
Even though I typed this in the VM Options
-Djava.library.path="C:Documents and SettingsOwner.GabyMy DocumentsjME2jMEliblwjglnativewin32"


Just because you typed something into the VM options in NetBeans doesn't allow you to run the program from the command prompt. You need to run the project in NetBeans if you're using VM options written IN NetBeans.

Hi!!



I got my jnlp file and all the files I need deployed by netbeans.

Also, I can download the app from my web site but after the download is complete I get an error:



Could not find main class <think.Lesson05>  ( Even though I've assigned the main class on netbeans )



Can somebody help me out with this exeption ??

</resources>

  <application-desc main-class="think.Lesson5"/>

</jnlp> ]

  at com.sun.javaws.LaunchDownload.getMainClassName(Unknown Source)

  at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)

  at com.sun.javaws.Launcher.run(Unknown Source)

  at java.lang.Thread.run(Unknown Source)



What can I do to be able to run the application?

I'd appreciate your help



Thank You! 

I see the tread is a few months old, but I just had the same problem with the JARs and also JNLPs.



I solved it by using OneJAR which is an ant target that repackages everything to… well… one JAR.  8) Everything, including the dynamic native libraries and jME etc! Very handy.



I wrote down how I hooked up the OneJAR target into the NetBeans build.xml here:

http://jmonkeyengine.com/wiki/doku.php?id=setting_up_netbeans_6.7_for_jme_2.0

OneJAR of course also works without NetBeans and with other IDEs.



I also wrote how to create simple launchers for Windows, Mac, Linux. (Well, the one for Mac is actually quite advanced.) I didn't try all the steps on a PC myself, so if you have feedback or suggestions, I will improve the tutorial if necessary.



Just mentioning it in case somebody has the same question now.


I followed your guide but I get an error. I'm trying to make a package using oneJar but when I clean & build I get the following output in netbeans:

/Users/Nerian/NetBeansProjects/Hello3D/one-jar-ant-task.xml:7: Warning: taskdef class com.simontuffs.onejar.ant.OneJarTask cannot be found
OneJAR: Creating distributable OneJAR
init:
deps-clean:
Deleting directory /Users/Nerian/NetBeansProjects/Hello3D/build
Deleting directory /Users/Nerian/NetBeansProjects/Hello3D/dist
clean:
init:
deps-jar:
Created dir: /Users/Nerian/NetBeansProjects/Hello3D/build/classes
Created dir: /Users/Nerian/NetBeansProjects/Hello3D/build/empty
Compiling 1 source file to /Users/Nerian/NetBeansProjects/Hello3D/build/classes
compile:
Created dir: /Users/Nerian/NetBeansProjects/Hello3D/dist
Building jar: /Users/Nerian/NetBeansProjects/Hello3D/dist/Hello3D.jar
Copy libraries to /Users/Nerian/NetBeansProjects/Hello3D/dist/lib.
To run this application from the command line without Ant, try:
java -jar "/Users/Nerian/NetBeansProjects/Hello3D/dist/Hello3D.jar"
jar:
BUILD SUCCESSFUL (total time: 1 second)

It creates Hello3D.jar but not  HelloApp.jar

I changed this line in one-jar-ant-task.xml

<property name="one-jar.dist.dir" value="/dist"/>

to
 
<property name="one-jar.dist.dir" value="../OneJar"/> 

And now there is no warning error, but still I don't get the helloApp.jar

I'm using Mac OS and Netbeans 6.7.

I'll keep searching the error, but any help will be appreciated :)

Thanks, I added the tip to fixed the ant task path that I had forgotten.



If compiling shows no errors, but the new task does not execute, got to the Files window, and right-click build.xml. You can run individual tasks from the context menu! I thought I had given it a dependenceny to run after the jar task, but maybe I got it wrong.