I have this chess engine i wrote in java. Thing is, I need to make a exe application that can take commands following a certain protocol (UCI). Ive had many problems trying to get this to work, but ill keep this brief and share the most important ones.
Other engines pop up cmd when you click on them, mine is just a basic java CLI (Dont know if this is a problem).
My anti virus keeps stopping me from opening the exe. Launch4j gives me a warning telling me I should sign it to prevent this sort of thing, but I dont know what that means.
So heres the deal, I know this post is word vomit, but Im truly at a loss right now. Id like general order advice on how I should approach the problem and maybe some advice on wether i should be using launch4j in the first place.
UPDATE: The reason i wanted to make an exe in the first place is because thats the format that was suggested in the lichess documentation (I wanted to upload my bot to lichess). I wrote a bat file that executes the jar file and it worked fine. Thanks to everyone for the suggestions.
Related
I have an application that I want to modify by adding my own little code.
In many sites, I looked through the methods of decompilation, editing, recompilation, but I still could not find the answer to my question.
How can I add my Java code to a compiled Android application?
WDYM? Android apps are often obfuscated before compiling which makes it very hard to understand the code.
Your question doesn't make sense to me. If you decompiled it, just open the files with any IDE and edit them?! You said you read about editing and recompilation... Well then, why cant you edit?
Note: What are you trying to do? If it isnt an offline game, then it's illegal (probably the terms of service of the app state that) and if you are trying to increase your coins or something there are simpler ways to do that. Learn about app development first and then try something more diffictult like this.
I have just completed my first java program. It's sitting in Eclipse pretty as a newborn (which really isn't all that pretty). Anyway, I need to have an icon on the desktop that allows users to click and run the code. I found an example of how to make a .jar from the project in Eclipse, but nothing happens when I click on it. There are a LOT of options in Eclipse so I'm guessing I need to select/deselect something, but the examples online are very few and far between. Since I'm sure I'm not the first person who has done this, I'm assuming I lack the vocabulary to find an answer. Could someone please give me a little direction to find help?
I have tried "compiling" but that's running the code. Anything with .java just tells me how to install Java. There have been too many searches to list them here. Suffice it to say I need a push in the right direction, please.
There isn't realy much to do wrong. Just go to Project -> export and select runnable jar file. Then you just have to pick the right launch configuration and click finish. There is a tutorial with picutres on wikiHow here.
I am creating a complex game, because of this I use System.out.println(); a lot to test to see if something works or to see if something went wrong. To see these messages I have been going to the CMD or terminal and running it from there but I was wondering if there was an easier way. I thought of a couple ways and came up with running with a batch, but I have no idea how to make one, and another way was to put a button in game that opens the console that the game is running in. I don't even know if the second one is possible but I was wondering if there was a way! Thanks in advanced!
This is what logging frameworks are for.
Use sfl4j - http://www.slf4j.org/ - in your code to generate the log events, and choose a suitable backend for your purpose. I would suggest using slf4j-simple which is easy to get started with and which easily can be sent to a file you can view in your favorite file viewer.
http://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html
So I'm working on a text based RPG as part of my programming class and
I would like my friends to be able to play it without a compiler. Is
there anyway I can put the game in a Dialog box or window so they can
just run it if they have Java?
*Edit: Code Can be provided but I don't think you'll need it as it is just the game fit for running in a compiler.
I think I'm confusing myself and everyone else. I am running the game in my IDE, jGrasp (because that's what we're supposed to use) and in there it will run. Unless I can export it as something else/make it appear as another file I don't know how to let people who don't have jGrasp or Eclipse play it.
Hope that clarifies.
This may be a little bit tricky if you are just starting out with Java, but I will walk you through it.
You will need to first turn your code into a JAR file. Depending on what IDE you are using, this can usually be found in file/export. Then you will need to run the file through a command prompt, such as Terminal.
Locate the jar file you exported, and put it into a easy to find location.
Open terminal and type this into the command prompt: java -jar /Path/to/yourfile.jar
Thats it! It is as if you are running it from your compiler. Just give your friends these instructions, and they will be able to play your game. Enjoy!
If you need something easier to run, look into Swing gui. This will be easier for your friends, but much harder for you.
I have a Java program .exe that is on my web site ..
it's a simple program that ask questions and answers .. it's safe if any one download it
but if my friends try to download it their antiviruses say "Threat has been detected"
is there any thing I can do to make it much safer to download it?
Thanks,
EDIT: Here's a screenshot of my program ..
actually it's written in Jess running from a Java class that has main method
http://img706.imageshack.us/img706/1710/quizj.png
Maybe you can try uploading your file to https://www.virustotal.com/. If many virus scanners are saying it is infected, then it surely is and you should search your computer for an infection by doing a hard(!) poweroff (so not virus shutdown hooks can be executed) and then use a live cd to scan your hard drive.
Otherwise it's just a false alarm. What does your application do? Can you provide a screenshot or a detailed error message?
I am reacting to
is there any thing I can do to make it much safer to download it
You could use an applet or better use Java Web Start to distribute your Java application take a look at the Webstart Tutorial