Skip to content
Advertisement

Tag: jar

Get jar manifest attributes from Java agent

I am running my own java agent on a jar containing some sample code. Input to the command line: I’m currently providing the sample-code.jar’s main class (as stated in its manifest) as an arg to the agent, although, I’m trying to find a way to access the sample-code.jar’s manifest’s Main-Class attribute from within the agent’s premain. I tried some of

java Program runtime is too fast? Issue with Memory

So I am running some simulations that require some sample datasets. For the sake of simplicity I am using this http://loremipsum.sourceforge.net/ Lorem Ipsum generator. I am setting a test parameter called DATASIZE that sets the amount of words or paragraphs this generator creates. I am using this generated data to create an “input” and “output” hash. The output data will

Split Packages: Java Modules vs Sealed Jars

Both Sealed Packages/Jars and the Java Module System disallow spliting packages across several jars. Does that mean that all packages contained within a Module are implicitly sealed? If not what does explicitly sealing the jar change? Answer Yes, packages within modules are always implicitly sealed. This is specified in the documentation of the Package class: A Package automatically defined for

.jar File can’t find image file path

I’m creating a simple program that I now want to export as a executable jar file. Everything works fine except the jar file can’t find the image. For creating the runnable JAR file I used the second option in Eclipse 2021-12 (Package required libraries into generated JAR). This seems to work well, because I only have the jar and no

Extract .jar file with NodeJS

I need to extract a JAR file using NodeJS and I have no idea how, also I’m not sure if StackOverFlow is the right place for this so sorry if it’s not. Answer so jar files are just java archive files that can be unzipped with any commonly available operating system tool like unzip or jar, so a simple command

How can I output a random image when in a jar file?

The below code works when running from my editor but the image fails to load when compiled into a runnable jar file with eclipse. Could someone please suggest how I can modify my code or editor to load the files when compiled. I have read other methods of accessing files but since I need to select randomly from a folder,

Advertisement