executable

NullPointerException when trying to run .jar file

断了今生、忘了曾经 提交于 2019-11-26 22:02:05
问题 I have just started learning java, and know only a small amount of code, however this is still a simple program. It is more of a prank program, but mostly just to test if I can make a jar file. Here is the code: import java.awt.*; import java.awt.event.*; import java.lang.*; import java.util.Random; public class randommouse { public static void main(String[] args) { for (int i=1; i<1000; i++) { Random rand = new Random(); int w = rand.nextInt(1024) + 1; int h = rand.nextInt(768) + 1; int t =

Showing JPG image with Qt does not work with release executable

ε祈祈猫儿з 提交于 2019-11-26 21:40:57
问题 i have a annoying issue with showing jpg images with qt. I devlope with Visual Studio 2008 in Windows 7 and using the Qt version 4.8.2. I will now describe my problem by means of the "collidingmice" example deliverd with Qt (../examples/graphicsview/collidingmice). I can build this example via Visual Studio IDE or with via the Visual Studio command prompt. In this example a jpg is used as background and is correctly shown when I execute the debug executable. But in release build this

How to include text files with Executable Jar

别来无恙 提交于 2019-11-26 21:33:21
问题 Hi guys rookie Java question. I have a Java project and I want to include a text file with the executable jar. Right now the text file is in the default package. InputFlatFile currentFile = new InputFlatFile("src/theFile.txt"); I grab the file with that line as you can see using src. However this doesn't work with the executable jar. Can someone please let me know how to keep this file with the executable jar so someone using the program can just click a single icon and run the program.

how can I create executable file for the program written on Java?

自闭症网瘾萝莉.ら 提交于 2019-11-26 21:04:05
问题 everyone, how can I create executable file for the program written on Java in Eclipse Helios? I mean to create small icon to be able start program only by double-clicking on its icon, thanks in advance edited I mean executable for Windows 回答1: Export .jar in eclipse. (how to) Use JSmooth (info) to make an .exe file. (how to) 回答2: Here is a tutorial that shows you how to make a jar file from eclipse. If Java is installed on the computer, you can execute your application by doubleclicking the

Is there any way to change directory using C language?

∥☆過路亽.° 提交于 2019-11-26 21:02:47
Is there any way by which I can change to any directory by executing a C program ? Depending on your OS there are different calls for changing the current directory. These will normally only change the current dir of the process running the executable. After the process exits you will be in the directory you started in. Michael Foukarakis The chdir() function. For more info, use man chdir . Santak Dalai chdir() changes only the current working directory of the process but not of the context in which you are working. Suppose you execute a program in the terminal and your current directory is

Why does the PLT exist in addition to the GOT, instead of just using the GOT?

十年热恋 提交于 2019-11-26 20:27:14
问题 I understand that in a typical ELF binary, functions get called through the Procedure Linkage Table (PLT). The PLT entry for a function usually contains a jump to a Global Offset Table (GOT) entry. This entry will first reference some code to load the actual function address into the GOT, and contain the actual function address after the first call (lazy binding). To be precise, before lazy binding the GOT entry points back into the PLT, to the instructions following the jump into the GOT.

How to achieve smaller size of the executable?

寵の児 提交于 2019-11-26 20:00:48
问题 Very recently I have come back to Delphi after a long pause and written a rather straightforward utility app my client requested to support an older release... I know these days the size does not matter much, but it struck me as odd that the one-unit application, when compiled, amounted to 1'084'416 b executable. The one and only .pas unit I wrote is some 20.8k large, mostly because of the richness of the gui. The uses clause is as follows: uses Windows, Messages, SysUtils, Variants, Classes,

How to monitor process/program execution in windows?

心已入冬 提交于 2019-11-26 19:04:15
问题 We are trying to develop a small application that can monitor the programs/processes that are executing in a windows machine. If the program/process is not supposed to run, it should be blocked. It works similar to an antivirus. This is the basic idea. I want to know the ways to hook into the OS to get notified about every single program/process trying to run in the machine. 回答1: The easiest way is to use WMI. Specifically monitor the Win32_ProcessStartTrace. This is better than Win32_Process

Java command line with external .jar

喜夏-厌秋 提交于 2019-11-26 18:46:07
I develop a project using .jar to reuse code. So I have on .jar named TOOLS.jar, and I develop a simple application in file HelloWorld.java wich refer my package TOOLS from TOOLS.jar I compile with this command line : javac -g -d C:\MyApp -cp TOOLS.jar HelloWorld.java It's successful, and when I want to execute my application I use this command (I'm in C:\MyApp folder) : java -cp <path>\TOOLS.jar;. HelloWorld It's successful, but my question is : How do I execute my application when I have multiples external .jar ? Do I Have to add each one in command with -cp option ? Is there a way to

Java : create jar executable with dependant jars embedded

北城以北 提交于 2019-11-26 18:37:03
问题 I have created an executable JAR with the manifest: Manifest-Version: 1.0 Main-Class: MyClass Class-Path: lib/ext.jar I can successfully run this JAR if I have folder lib with dependent ext.jar in the folder of .jar created. I would like to embed ext.jar in my executable JAR to launch it anywhere I want, without creating lib folder. This would allow the JAR file to be self-contained, including all of its dependencies. Is there any way to do this? 回答1: The default Java class loader cannot find