Corrupt jar files

6 replies [Last post]
Offline
Joined: 01/31/2014

 I recently finished a very basic enviroment andtried to make a jar file of it. However, it was corrupt, even with the main class and the main() method. HELP!

 YOLOOOOOOOOOOOOOOOOO!

Offline
Joined: 11/23/2013
Try this...

 Hey D-B.

 

There are two ways of getting the .jar

 

First is to click project (top left) and click create .jar. This takes allot of this since it will copy the whole folder at a pretty slow pace. Wait maybe 5-10 minutes.

 

second is to right click a class that has:        

public static void main(String [] args) {
        (new main()).play();      
}

inside of it and click create distribution .jar file. This one goes much faster and also gets you .exe and mac applet. 

 

You really need to put more info in your help requests. The information you have supplied is weak. Corrupt can mean any number of things.

 

Try to be more specific if you want help faster.

 

Hope this helps, cheers!

Offline
Joined: 11/23/2013
read this link...

#link to exe/ .jar creation

 http://env3d.org/beta/node/1541

Offline
Joined: 01/31/2014
 I didn't post more

 I didn't post more information because I didn't know what info you would need. I did the 1st option, and it gave me a folder with lots of files. I clicked the file with the name that

I had given it. However, it did nothing I clicked the env3d.jar file, and it gave me a java exeption. Also, I tried the env3d menu option, it didn't appear.

 

 YOLOOOOOOOOOOOOOOOOO!

Offline
Joined: 11/23/2013
Try this...

 Hello! Do the following:

 

Create a new class called Game.

 

Put this inside of it:

    

public class Game
{    
    public Game()
    {        
    }    
    public static void main(String [] args) {
        (new Yolo() ).play();      
    }
}
 

 

This would only work if your controller class is called Yolo and your looping method is called play.

Basicly replace "Yolo" with the name of your main controller class and "play()" with the name of your game loop method. But better to use play() it worked for me.

 

And make sure your main loop method is public for example:

 

In a main controller class called "Yolo" you would find the main method play() as seen below

 

 

public void play() 
{
    while(!finished){   //this be the looping method
          //
          // this be your games code
    }
}
 

If your main class is called Game then name the new class GameApp or something else but just make sure you respect the following:

 

for a new class called GameApp:

public class GameApp

 

{    
    public GameApp()
    {        
    }    
    public static void main(String [] args) {
        (new Yolo() ).play();      
    }

}

Make sure you can't find whats below ANYWHERE in your code exept in the new class you have created or it won't work. 

public static void main(String [] args) { 
        (new Yolo() ).play();      
  }
 
Now compile your program, close it restart it and recompile it and now, you should be able to see the deploy menu when you right click on the Game (or "GameApp") class. Make sur you let it work for a while before dismissing.
 
All this seems to neccesary when there are too many methods insode your main class so by diverting the code in a new simpler class the program can find the deploying code easier. 
 
Hope this helps, Cheers!
Offline
Joined: 01/31/2014
I don't see the dropdown menu

I don't see the dropdown menu anymore, and bluej's doen't work!

 YOLOOOOOOOOOOOOOOOOO!

Offline
Joined: 12/13/2010
If you can't see the

If you can't see the dropdown, do the following:

- Make sure you close all the BlueJ projects (Ctrl-W I think).

- Close BlueJ.

- Re-open BlueJ, now use "Project -> Open Project" to open your env3d_template

- The env3d menu should be back

 

The problem basically is that BlueJ can only handle one env3d_template project opened at a time.  If you have 2 or more projects opened, it will screw it up.

 

Jason.