Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Learning Class : Packaging Applet in JAR Files and deploying.  (Read 5199 times)
0 Members and 1 Guest are viewing this topic.
Offline Gudradain
« Posted 2010-12-13 20:15:17 »

So here is the second entry in the learning class!!

Subject : How do you package your applet in a JAR files and deploy it? What are the step that you take to do so?

Description

The step I take to package and deploy an unsigned applet are the following :

1. I make sure that my code is complete and that there is no bug.
2. I put all my class files and ressources (images, music) in an empty folder.
3. I open the command prompt and navigate to this folder.
4. I type the following command : jar cvf Test.jar *
5. I make an html page with the following content :
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
<html> 
 
<head>
<title>Applet test</title>
</head>
 
<body>
<h2>Applet test</h2>
 
<applet code = 'basicGame.BasicApplet3'
    archive = 'Test.jar',
    width = 800,
    height = 600 />
   
</body>
 
</html>


6. I upload both files ("Test.jar" and "AppletTest.html") on my server using an ftp client (FileZilla in my case)
7. Here is the result : Applet Test

Notes

These steps don't work for signed applet.

---------------------------------------------------------------

So how do you guys do it? Any way to make it faster/easier?
Offline gouessej
« Reply #1 - Posted 2010-12-13 20:18:26 »

Use Ant or Maven.

Offline Captain Awesome

Junior Devvie


Medals: 2


Hi


« Reply #2 - Posted 2010-12-13 20:19:45 »

The applet tag is deprecated in favour of the object tag.
See this for more information: http://www.w3.org/TR/html401/struct/objects.html#edef-APPLET

Also I use netbeans to handle packaging of my projects. All I do is click a button and automatically creates the .jar file and copies the libraries Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Gudradain
« Reply #3 - Posted 2010-12-13 21:37:23 »

The applet tag is deprecated in favour of the object tag.
See this for more information: http://www.w3.org/TR/html401/struct/objects.html#edef-APPLET

Also I use netbeans to handle packaging of my projects. All I do is click a button and automatically creates the .jar file and copies the libraries Smiley

I have some problem with the object tag. I made a new html file with the following content but it doesn't work.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
<html> 
 
<head>
<title>Applet test</title>
</head>
 
<body>
<h2>Applet test</h2>
 
<OBJECT codetype="application/java"
        classid="java:basicGame.BasicApplet3"
        archive="Test.jar"
        width="800" height="600">
Java applet that draws a moving square.
</OBJECT>    
</body>
 
</html>


Using netbeans or eclipse is a great idea I should include that.

Use Ant or Maven.

Ant and Maven seems like great tools when you have a big project but I don't think they are really usefull when you only have a few class and ressources. Also, I'm not able to talk about them because of my lack of knowledge.
Offline Gudradain
« Reply #4 - Posted 2010-12-13 21:51:13 »

Not sure if changing to the Object tag right now is a good idea. From wikipedia :

Quote
However, despite object being officially a recommended tag, as of 2010, the support of the object tag was not yet consistent among browsers and Sun kept recommending the older applet tag for deploying in multibrowser environments,[21] as it remained the only tag consistently supported by the most popular browsers. To support multiple browsers, the object tag currently requires JavaScript (that recognizes the browser and adjusts the tag), usage of additional browser-specific tags or delivering adapted output from the server side. Deprecating applet tag has been criticised.[22] Oracle now provides a maintained JavaScript code [23] to launch applets with cross platform workarounds.
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 81
Projects: 15


★★★★★


« Reply #5 - Posted 2010-12-13 21:56:03 »

stick with the applet tag as it works everywhere, the object tag is useless, its complicates things and doesn't work in some browsers (like firefox).
Offline DzzD
« Reply #6 - Posted 2010-12-14 00:31:46 »

APPLET tag is still (and for long) and IMO the BEST way

IMHHHO : W3C... just recommend you to use new things, not things that are compatible, you know ... they just try to force people to conform to their recomendations, but those recommendation are not relevant in real world, this kind of organisaton need a reason to exist but the WEB is self-building...

Quote
Using netbeans or eclipse is a great idea I should include that.

for a simple HelloWorld Applet really ?

EDIT: your sample is nice enought

Offline Nate

« JGO Bitwise Duke »


Medals: 158
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #7 - Posted 2010-12-14 03:44:11 »

Using Scar to build signed, packed LWJGL applet JARs and it generates an applet.html file:

1  
2  
3  
build(project);
keystore("keystore", "alias", "pw", "Company", "AppName");
lwjglApplet(project, "keystore", "alias", "pw");


Of course, it is only that simple once you get it working, but I find mucking around with Java code more fun than mucking around Googling for Ant XML tags.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (24 views)
2014-12-23 03:34:11

rwatson462 (55 views)
2014-12-15 09:26:44

Mr.CodeIt (45 views)
2014-12-14 19:50:38

BurntPizza (86 views)
2014-12-09 22:41:13

BurntPizza (110 views)
2014-12-08 04:46:31

JscottyBieshaar (81 views)
2014-12-05 12:39:02

SHC (91 views)
2014-12-03 16:27:13

CopyableCougar4 (98 views)
2014-11-29 21:32:03

toopeicgaming1999 (157 views)
2014-11-26 15:22:04

toopeicgaming1999 (154 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!