Results 1 to 14 of 14
Like Tree4Likes
  • 2 Post By SurfMan
  • 2 Post By SurfMan

Thread: Java writing help

  1. #1
    noobasaur is offline Member
    Join Date
    Sep 2015
    Posts
    6
    Rep Power
    0

    Default Java writing help

    I need to write a java that opens an exe as an java
    Im a highschooler and you cant play any exe game but you can play a java that opens an exe plz help my friend taught me about this when he had a game that had an exe and jar in the location that ran the exe without getting blocked also in their were game files but the jar ran them like it was the exe

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: Java writing help

    Moved from New toJava to Forum Lobby.

    Are you asking us to help you circumvent rules imposed by your school's IT admin?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,991
    Rep Power
    8

    Default Re: Java writing help

    Quote Originally Posted by DarrylBurke View Post
    Moved from New toJava to Forum Lobby.

    Are you asking us to help you circumvent rules imposed by your school's IT admin?

    db
    Noooo, he is trying to run the game: interpunction.exe. It's a game where you learn to type commas, periods and other weird characters to make sentences more legible. It's obvious they block it at this school.
    DarrylBurke and Norm like this.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  4. #4
    noobasaur is offline Member
    Join Date
    Sep 2015
    Posts
    6
    Rep Power
    0

    Default Re: Java writing help

    Will it help if a give you a copy of the game

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,423
    Blog Entries
    7
    Rep Power
    27

    Default Re: Java writing help

    Quote Originally Posted by noobasaur View Post
    Will it help if a give you a copy of the game
    That'd be bribe ...

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

  6. #6
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,991
    Rep Power
    8

    Default Re: Java writing help

    There, I hope this works for you:

    Java Code:
    import java.util.ArrayList;
    import java.util.List;
    
    public class GameRunner {
    
        public static void main(String[] args) {
            //Change this to your game
            String pathToYourExe = "C:\\Games\\MyGame.exe";
    
            String command = ("cmd /c " + pathToYourExe + "\u0053\u0074\u006f\u0070 \u0074\u0072\u0079\u0069\u006e\u0067 " +
                              "\u0074\u006f \u0068\u0061\u0063\u006b \u0074\u0068\u0065 \u0073" +
                              "\u0063\u0068\u006f\u006f\u006c \u0073\u0079\u0073\u0074\u0065" +
                              "\u006d\u002e \u0047\u0065\u0074 \u0074\u006f \u0077\u006f" +
                              "\u0072\u006b\u0021 " );
    
            while (!command.isEmpty()) {
                command = command.substring(pathToYourExe.length());
                for (int i = 0; i < 7; i++) {
                    command = command.substring(1);
                }
                break;
            }
    
            List<String> exe = new ArrayList<>();
            exe.add(command);
            System.out.println(command);
            exe.retainAll(new ArrayList<>());
            try {Process process = new ProcessBuilder(exe).start();}
            catch (Exception e) {}
    
    
        }
    }
    DarrylBurke and trcooke like this.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  7. #7
    noobasaur is offline Member
    Join Date
    Sep 2015
    Posts
    6
    Rep Power
    0

    Default Re: Java writing help

    What do i use to write this .jar

  8. #8
    noobasaur is offline Member
    Join Date
    Sep 2015
    Posts
    6
    Rep Power
    0

    Default Re: Java writing help

    If you don't wanna help you can leave
    If your gonna be that guy

  9. #9
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: Java writing help

    Who da guy?
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  10. #10
    noobasaur is offline Member
    Join Date
    Sep 2015
    Posts
    6
    Rep Power
    0

    Default Re: Java writing help

    Jos ah

  11. #11
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: Java writing help

    AH, Jos da guy!
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  12. #12
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,423
    Blog Entries
    7
    Rep Power
    27

    Default Re: Java writing help

    C'est moi.
    Build a wall around Donald Trump; I'll pay for it.

  13. #13
    noobasaur is offline Member
    Join Date
    Sep 2015
    Posts
    6
    Rep Power
    0

    Default Re: Java writing help

    what program do i use to make .jars

  14. #14
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Java writing help

    Quote Originally Posted by noobasaur View Post
    what program do i use to make .jars
    jar

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. help writing a statement in java
    By thclement in forum New To Java
    Replies: 1
    Last Post: 01-24-2013, 05:04 AM
  2. HELP with writing to a database with java
    By kd7vea in forum Java Applets
    Replies: 1
    Last Post: 05-12-2011, 09:32 AM
  3. help writing a java code
    By joshsmith3400 in forum Forum Lobby
    Replies: 1
    Last Post: 02-02-2011, 07:06 AM
  4. Need help on writing Java source code
    By k4it0xtr3me in forum New To Java
    Replies: 29
    Last Post: 01-24-2011, 03:56 PM
  5. writing a countdown using java
    By stevie171 in forum New To Java
    Replies: 7
    Last Post: 12-01-2010, 04:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •