Creating a runnable jar with jme included (eclipse)

Well I finally made my program so far that i wanted to do some tests with a few friends.



However even working from eclipse without any problems, I don't get how I can export it working.



The normal export runnable jar gives me a few thousand errors, in every class that works with any jme stuff, however ti works when I use it with a simple testapplication (just a jframe, but hey).



Then due to some forum searches I tried Fatjat, this does not give me any export errors, (or at least i don't see any) but when i try to start it tells me:



Failed to load Main-Class manifest attribute from blablabla New Horizons Client_fat.jar  (i tried renaming to without space same result)

Are you sure you are including all the libraries in your distro?

To be true, I'm absolutly not sure :confused:



I just hit export and hoped it might work as I hoped, wich it does not, then I tried to find a solution in the forum search but failed as well.



I have the jme2 from svn as a project in eclipse

my own project has this project added under build path/Projects.

If this was NetBeans I could walk you through it with my eyes closed, hopefully someone with more Eclipse experience will post some pointers…

Noone an idea? :frowning:

The easiest solution would be to only jar your application. Then you can place your jar, along with all the jME jars in a directory. You can specify your own manifest so that java knows where to find the required jars and libraries. Then copy the required native libraries into the directory and your golden, just double click your app jar file.



A sample manifest which you will need to modify:


Manifest-Version: 1.0
Sealed: true
Class-Path: ./jme.jar ./jme-audio.jar ./jme-gamestates.jar ./jme-awt.jar ./jme-audio.jar ./jme-scene.jar ./lwjgl.jar ./fenggui.jar
Main-Class: com.acarter.applicationx.Main



You should end up with a folder that contains:
- Your application jar
- All required jME jars
- All required native libraries

When you have that going, then you can experiment different options.

Ok I have tired it several times ad always failed.



Well I get this trying to export my project, any idea where i can see the actuqall warnings/errors?





And yes, thats already the detailed view  :expressionless:

Those are only warnings so that should work fine. They are the same warnings you will find in the Error/Warnings pane in the eclipse editor.

Funny fact, in the error/warning pane, there are non O.o



Well I got it somehow to work mostly, the jme stuff seems to work, jsut my workspace folder where the textures where is not yet working, but I think i will get that to run aswell somehow …

Progress is always good!

Hm does anyone maybee know why the textures won't load?



This is what I currently have:



http://empirephoenix.de/NHC.rar



and the sources



http://empirephoenix.de/NHC-source.rar

try the checkbos "Export Java source files and Resources" … in fact, try ALL checkboxes, see if it works and then work your way through to find out what you dont have to export  :wink:

Hm tryed and extraced the jar after.



The jar file contains all stuff (even the jmetests  :D)



So it's probably something with the copyed loading code.

I now have created a very simple test programm:



//package Core;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class simpletest {
   public static void main(String[] b3la) throws IOException{
      // InputStream bla = ClassLoader.getSystemClassLoader().getResourceAsStream("Core/test.txt");
                        InputStream bla = ClassLoader.getSystemClassLoader().getResourceAsStream("test.txt");
      InputStreamReader hans = new InputStreamReader(bla);
      BufferedReader hans2 = new BufferedReader(hans);
      System.out.println(hans2.readLine());
   }
}



What i found out so far:

If the class and the text file are in the default package, it works in eclipse and exportet in a jar

If the class and the text file are in a Subpackage (Core) it works in eclipse, but not exportet.

The exportet jar contains the same Filestructure as the Eclipse navigator, does anyone has an idea what i can do?

What i really want to do is a seperation:
my code in a package (Core)
and the other stuff in another folder/package, how can I archive this, and also where is the msitake in my example?