JAVA4K GAMES DOWNLOAD

Hi guys.Im newb here so sorry if this againt any rules here.
I want to know how to download those games at java4k.com.There are no download button.
I really want to play those games since it look so cool.
Especially these game “GTA4K” and “DRIVER4K”.
If anyone know or have those games please link them to me.
Thanks.

Hi

They are packaged as applets, you cannot run them as softwares or applications, you have to use an applet viewer. You can download them by analysing the source code to get the URL of the JAR. I don’t think that you break the rules except if you don’t respect their terms of use. I tried to find a solution but something prevented me from using “applet.php” with the game identifier.

It stranged me that there is no download button but every games on that website has download stats. ???
Thanks for a few authors there that kind enough to include their games sources code so i can compile and play it on browser using html applet.
Where i have to search for the jars url?Used inspect element and page source didnt found any link for the jars.
Thanks.

The URL looks like this for GTA4K:
http://www.java4k.com/applet.php?gid=280

but something prevents you from downloading the JAR. I can reinstall IcedTea Web OpenJDK plugin and try to look for the downloaded JAR. Maybe Appel can tell us how to work around this problem.

Please if you could, I cant try that plugin im on windows.Good luck.

I tried using the Java4K launcher and observed the console. It seems that the download is not successful, the applet.php is returning 0 bytes for the above two games.

I tried GTA4K first which is index 280, and then I tried Driver4K which is index 291. And indeed the files 7f and 80 are 0 bytes, they are null files.

I tried to do this two to three times, but I got the same result. I thought let me try a different game. I tried Tilt Maze 4K done by luisoft for 2012 Java4K, and also CrazyBricks4K by @ctomni231 on this forum. Neither of the games were downloaded, they are 0 KB.

So I came to the conclusion that this is a bug in the applet.php file, or might be that the files are unavailable now. I tried ten other games and none of them worked too.

I think we can do nothing about this now, unless appel comes in.

Yeah seems like the host to the files no longer responding.I got error404.000webhost.com when tried every games on java4k website.

000webhost is well known to take down websites when they never used paid services, so if the site used their hosting this was just a matter of time.

I have everything backed up and I will make it available to a responsible party.

How is not ‘anybody’ a responsible party? Just upload all those jars/classes to a dropbox account - these files were publicly available once, after all. Numerous people have offered before to take over the java4k data/code - including me. What are you looking for in this responsible party? How do we know whether we qualify?

Im really happy to hear this. ;D
Please post the link here.Thanks.

I fixed the jars on the website, they should be downloadable now.

You can get json here for contests and games (should be self explanatory):
http://java4k.com/contests.php

However, it seems that 000webhost deleted the jar folder because it wasn’t stored in the right place. I’ve restored as much as I can, with the backups I had, but it seems most recent games are missing. I will keep looking, or contact 000webhost (which I expect is futile).

Hi

Use this link to get the pack.gz file of GTA4K:
http://www.java4k.com/applet.php?gid=280

Decompress this archive:

[quote]gunzip GTA4K.pack.gz
[/quote]
Use unpack200 on the .pack file to obtain the JAR:

[quote]unpack200 GTA4K.pack GTA4K.jar
[/quote]
Make a small HTML web page containing an applet using GTA4K.jar and use its URL with the applet viewer, it should work.

If I could, I would wrap the applet into a software and package it with JNDT so that you would just have to get the executable and run it. Maybe it would be a nice project to help people to go on playing these games. appel, would it be legal?

P.S: There is already the Java4k launcher. The prior authorization of the authors is required to (re)publish or (re)upload the games elsewhere.

Thanks guys.
@ gouessej
I tried your method and it worked. ;D
Good luck with that laucher.

@Bogart You’re welcome. You can post the HTML source code if you want to help the newbies :wink: Actually, as long as I don’t have the authorization of the authors, I won’t start implementing another launcher, I respect the authors’ rights. If you need some help to make GTA4K work without applet support, let me know (this might help).

I’d write another class which just adds the class to a JFrame. Applets work like this without any restrictions.


JFrame frame = new JFrame("GTA-4K");

frame.setResizable(false);
frame.setPositionRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Applet applet = new A(); // Assuming this is the class name, haven't checked
applet.setSize(600, 600);

frame.add(applet);
frame.pack();

frame.setVisible(true);

applet.start();
applet.init();

This code is from memory, and it should mostly work. Just change the class name and you will be fine.

Haha, Im still a newb.This is my codes.

<center><applet code="A"archive="A.jar"width="800"height="600">

About that run without applet support, could you show me an example using GTA4K source codes?So i can learn from that to make my own later.

@SHC
Sorry, i didnt know how to use those codes.

Use SHC’s source code + replace java.awt.Applet with java.awt.Panel or javax.swing.JPanel both in GTA4K and in SHC’s source code. You can use jd-gui to decompile GTA4K. I’ve looked at its source code, the class extends Applet and implements Runnable. N.B: Rather use setSize(800, 600); as it is the expected hardcoded size.

If you use SHC’s suggestion without mine, it will work with Java >= 1.9 but not with Java 1.10. Keep in mind that you cannot reupload the class files elsewhere without the prior consent of the copyright owner. If you do something with the code, keep it for you. Some developers explicitly forbids republishing modified versions of their games even though they release their code, it’s the case of “notch” alias Markus Persson for his game “Breaking the tower” and maybe Miners4K too.

Maybe we should contact SimonH, the author of GTA4K.

I meant could you show me edited of the source code here? 8)

Use Java Decompiler to open the JAR and get the source code of the class A. Copy the source code into a file named A.java.

Replace

import java.applet.Applet;

by

import java.awt.Panel;

Replace

public class A
  extends Applet
  implements Runnable

by

public class A
  extends Panel
  implements Runnable

At the end of the class before the last closed bracket ‘}’, insert this:

public static void main(String[] args) {
    JFrame frame = new JFrame("GTA-4K");

frame.setResizable(false);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

A panel = new A(); // Assuming this is the class name, haven't checked
panel.setSize(800, 600);

frame.add(panel);
frame.pack();

frame.setVisible(true);

panel.start();
}

Enter

[quote]javac A.java
java A
[/quote]
and you’re done. If you want to make a JAR, don’t forget to add a manifest file MANIFEST.MF containing at least:

Main-Class: A

use this to create the new JAR:

jar cmf MANIFEST.MF GTA4K.jar A.class

Do NOT republish the whole source code without the prior consent of the author, SimonH.