executable

Creating a JAR file which contains other library files

混江龙づ霸主 提交于 2019-11-27 01:42:24
问题 I want to create one executable JAR file which contains other JAR libraries. But when I execute the JAR, it gives an error of class path problem. How do I solve the class-path problem? 回答1: I think you can try it like this; Here is a simple example for you question. First, we assume we have a project directory like D:\javademo . In this working directory we then create a main class HelloWorld.java and thtat contains our other JAR files, like commons-lang.jar . Now, we must archive our main

python: Can I run a python script without actually installing python?

邮差的信 提交于 2019-11-27 01:30:05
问题 I have some .py files I wrote that I want to run on a different machine. The target machine does not have python installed, and I can't 'install' it by policy. What I can do is copy files over, run my stuff, and then remove them. What I tried was to just take my development python folder over to the target machine and cd to the python folder and run python.exe /path/to/.py/file . It gave me an error saying that python.dll was not registered. If I registered the DLL that is probably going to

how to export a executable jar in gradle, and this jar can run as it include reference libraries

戏子无情 提交于 2019-11-27 01:01:03
问题 how to export a executable jar in gradle, and this jar can run as it include reference libraries. build.gradle apply plugin: 'java' manifest.mainAttributes("Main-Class" : "com.botwave.analysis.LogAnalyzer") repositories { mavenCentral() } dependencies { compile ( 'commons-codec:commons-codec:1.6', 'commons-logging:commons-logging:1.1.1', 'org.apache.httpcomponents:httpclient:4.2.1', 'org.apache.httpcomponents:httpclient:4.2.1', 'org.apache.httpcomponents:httpcore:4.2.1', 'org.apache

How can I package my Perl script to run on a machine without Perl?

江枫思渺然 提交于 2019-11-27 00:30:33
问题 People also often ask "How can I compile Perl?" while what they really want is to create an executable that can run on machines even if they don't have Perl installed. There are several solutions, I know of: perl2exe of IndigoStar It is commercial. I never tried. Its web site says it can cross compile Win32, Linux, and Solaris. Perl Dev Kit from ActiveState. It is commercial. I used it several years ago on Windows and it worked well for my needs. According to its web site it works on Windows,

How to check if a program is using .NET?

﹥>﹥吖頭↗ 提交于 2019-11-27 00:26:44
Can we check if a running application or a program uses .Net framework to execute itself? There's a trick I once learned from Scott Hanselman's list of interview questions . You can easily list all programs running .NET in command prompt by using: tasklist /m "mscor*" It will list all processes that have mscor* amongst their loaded modules. We can apply the same method in code: public static bool IsDotNetProcess(this Process process) { var modules = process.Modules.Cast<ProcessModule>().Where( m => m.ModuleName.StartsWith("mscor", StringComparison.InvariantCultureIgnoreCase)); return modules

Compile a Standalone Static Executable

孤街浪徒 提交于 2019-11-27 00:07:04
问题 I'm trying to compile an executable (ELF file) that does not use a dynamic loader. I built a cross compiler that compiles mips from linux to be used on a simulator I made. I asserted the flag -static-libgcc on compilation of my hello.cpp file (hello world program). Apparently this is not enough though. Because there is still a segment in my executable which contains the name/path of the dynamic loader. What flags do I use to generate an executable which contains EVERYTHING needed to be run?

What are the uses of self modifying code?

谁说胖子不能爱 提交于 2019-11-27 00:01:50
问题 Is there any real use for self modifying code ? I know that they can be used to build worms/viruses, but I was wondering whether there is some good reason that a programmer may have to use self modifying code. Any ideas? Hypothetical situations are welcome too. 回答1: Turns out that the Wikipedia entry on "self-modifying code" has a great list: Semi-automatic optimization of a state dependent loop. Runtime code generation , or specialization of an algorithm in runtime or loadtime (which is

what's in a .exe file?

点点圈 提交于 2019-11-26 23:59:32
问题 So a .exe file is a file that can be executed by windows, but what exactly does it contain? Assembly language that's processor specific? Or some sort of intermediate statement that's recognized by windows which turns it into assembly for a specific processor? What exactly does windows do with the file when it "executes" it? 回答1: MSDN has an article "An In-Depth Look into the Win32 Portable Executable File Format" that describes the structure of an executable file. Basically, a .exe contains

make your Jar not to be decompiled

被刻印的时光 ゝ 提交于 2019-11-26 22:59:22
How can I package my Java application into an executable jar that cannot be decompiled (for example , by Jadclipse)? You can't. If the JRE can run it, an application can de-compile it. The best you can hope for is to make it very hard to read (replace all symbols with combinations of 'l' and '1' and 'O' and '0', put in lots of useless code and so on). You'd be surprised how unreadable you can make code, even with a relatively dumb translation tool. This is called obfuscation and, while not perfect, it's sometimes adequate. Remember, you can't stop the determined hacker any more than the

Antivirus False positive in my executable

半世苍凉 提交于 2019-11-26 22:21:01
I just ran into an annoying problem. Suddenly Avira AntiVir started to flag one executable from my software as being a virus. As the default action from almost any user is to click OK and Avira suggests to put the virus in quarantine, most of my users are deleting this executable. Well, let's not be arrogant and check if I'm not infected indeed. I posted the file to http://www.virustotal.com and from all anti virus only Avira flags it as infected. Furthermore I scanned my computer with two different anti viruses and it is clean. I already posted a mail to my users explaining what is happening