JAVA4K GAMES DOWNLOAD

Im keep getting erorr and error while compile…post full code please.

Can I ask what did you try? Have you looked at the error? I think it is easy to solve this yourselves.

It took me only ~three minutes to get it running. I think you should try it yourself too.

Even the fresh source code(not replace anything) i got this error:


C:\Program Files (x86)\Java\jdk1.8.0_101\bin>javac A.java
A.java:225: error: unclosed character literal
    double[][] arrayOfDouble = new double['?']['�'];
                                               ^
A.java:225: error: illegal character: '\u00bf'
    double[][] arrayOfDouble = new double['?']['�'];
                                                 ^
A.java:225: error: illegal character: '\u00bd'
    double[][] arrayOfDouble = new double['?']['�'];
                                                  ^
A.java:225: error: unclosed character literal
    double[][] arrayOfDouble = new double['?']['�'];
                                                   ^
A.java:311: error: unclosed character literal
        arrayOfDouble = new double['?']['�'];
                                        ^
A.java:311: error: illegal character: '\u00bf'
        arrayOfDouble = new double['?']['�'];
                                          ^
A.java:311: error: illegal character: '\u00bd'
        arrayOfDouble = new double['?']['�'];
                                           ^
A.java:311: error: unclosed character literal
        arrayOfDouble = new double['?']['�'];
                                            ^
8 errors

C:\Program Files (x86)\Java\jdk1.8.0_101\bin>

That might be an issue since the class is obfuscated before decompiling, so the decompiled sources were incorrect. You have to directly use the original class and use my method now, just keep it as applet, and add it to a frame.

Use an editor that supports UTF-8 or use “Save” in JD-GUI.

Personally, I still get tons of compile errors but not the same than Bogart. Both Java Decompiler and CFR produce wrong source code.

I won’t post the full source code without the prior consent of the copyright owner but I’ll do my best to help you out. SHC’s suggestion works if you use the unmodified .class file and write another class with a main method except if you use a version of Java without applet support which will be the case of Java 1.10 in a far future.

P.S: It works with Procyon!!!

java -jar procyon-decompiler-0.5.30.jar -jar GTA4K.jar

My changes in the source code:

12c12,15
< import java.applet.Applet;
---
> import java.awt.Panel;
> import java.awt.Dimension;
> import javax.swing.JFrame;
> import java.awt.BorderLayout;
18c21
< public class A extends Applet implements Runnable
---
> public class A extends Panel implements Runnable
719,721c722,724
<             if (!this.isActive()) {
<                 break;
<             }
---
>             //if (!this.isActive()) {
>             //    break;
>             //}
729a733,750
>     
>     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(new Dimension(800, 600));
> panel.setPreferredSize(new Dimension(800, 600));
> frame.setLayout(new BorderLayout());
> frame.add(panel, BorderLayout.CENTER);
> frame.setVisible(true);
> frame.pack();
> 
> panel.start();
> }

Ok first make sure you get same decompile file as me(used procyon-decompiler) size 35KB 731 lines in notepad++.Fresh
After make changed, i got it compiled without any error. :slight_smile: My class file is 14KB.
Then i created GTA4K.jar, but it doesnt pop up anything when i launch it. :frowning:
Any suggestion?

Did you call the init and start methods on the A class?

Nvm i got it working now using online compiler (compilejava.net).
Thanks guys.Time to experiment this with others games. ;D

Hi

I advise you to run your JAR in command line first (java -jar GTA4K.jar). Check that you created a manifest file with the Main-Class attribute as I said earlier and ensure that you added it into the JAR. My method works, I succeeded in playing with GTA4K and it has the advantage of being future-proof (there was an error in SHC’s code, he wrote setPositionRelativeTo instead of setLocationRelativeTo).

I don’t see how compilejava.net helps. It works with Procyon. I gave you all the necessary steps.

I had it solve today, turn out i need to leave at least one blank line after “Main-Class: A” in manifest. :slight_smile: