jar

How do I create executable Java program?

Hi I have programmed a Java Program in JCreator, everything is done, but I want to create an executable file from it, ie I dont want to have to run the program by loading the java classes and compiling then executing, but instead have it as a stand alone executable file. What the quickest way to do this? Thank You ...

Creating a jar file from a Scala file

I'm new to Scala and don't know Java. I want to create a jar file out of a simple Scala file. So I have my HelloWorld.scala, generate a HelloWorld.jar. Manifest.mf: Main-Class: HelloWorld In the console I run: fsc HelloWorld.scala jar -cvfm HelloWorld.jar Manifest.mf HelloWorld\$.class HelloWorld.class java -jar HelloWorld.jar =...

Allocate more heap space to a Java jar

When you run a program through the command line, you can use java -Xms -Xmx to specify the heap sizes. If the program is going to be run by double clicking a .jar file, is there a way to use more heap than the standard? ...

Problem with paths in a java jar.

I have a folder called Etc which has an image I want to use in another file in the same folder, Example.java. So I have Etc\image.png and Etc\Example.java. I've tried using "Etc/image.png" as the image path, but that didn't work. How should I go about this? Also, suppose the files were in different packages, how would I do it? My main ...

Obfuscating Jar files with other Jar files embedded

So figure we have a Jar file with our Java application, and it has inside of it the Jar files for the libraries it depends of, a the jdbc or any other third party jar. How do you proceed to obfuscate it with free software? I mean, obfuscate your code and leave the Jars untouched. I tried with Proguard, to no avail. Even the author told...

Eclipse: Is it possible to edit Java source known via source code "attachment"

I am using Eclipse 3.4.2 to develop my code. As part of my project definition I reference a utility library to which I have attached the source code. So far, so good - I can see that source when I bring up classes from the library and while I am debugging. Now however I would like to make a change to one of the classes while still ret...

Ant: Check if class exists in a jar

How do I check if a particular class exists in a jar file? I tried available task and it does not seem to work If there is a way, can I use patterns in it? For example, I want to check if a class matching pattern **/xyz/foo.class exists in foobar.jar Any direction appreciated. ...

m2eclipse Indexing 3rd-party jars from Maven repository

Hi, I am using Nexus repository. and using Eclipse 3.4 with m2eclipse plugin installed. sometimes I need to upload jars that are not located in the central repositories (Like Sun jars). so I upload them under the "3rd-Party" section in Nexus. The problem is that when trying to add those jars as dependencies, eclipse does not index them ...

How can I verifiy signed JARs with pure Java?

I don't want to use the jarsigner -verify. Is there no JAR util package for my problem? I just want to verfiy a JAR in pure Java. ...

making a .jar file with source and project structure?

I wonder if this is possible with ant and java: I have a Java project which looks like this: ./ build.xml src/ com/ example/ {.java files here} bin/ com/ example/ {compiled .class files here} lib/ {3rd-party jar files here} dist/ {jar file(s) here} I know how to make a .jar file...

Including a non-Mavenized dependency so it works with maven-shade-plugin

I want to include GData Client, which doesn't use Maven, as a dependency into my Maven project. It ships as a bunch of JAR files. Additionaly, I use Maven Shade Plugin to build an executable JAR without any external dependencies (with the default configuration, no renaming/including/excluding/transforming of dependencies). How can I do...

Automatically generating source and doc jars in Netbeans

Is there a way to automatically generate source and javadoc jars in Netbeans? Ideally I would like to place jars of my source and JavaDoc in the dist folder each time i build. ...

Generate manifest class-path from <classpath> in ant

In the build file below, the jar target refers to the jar.class.path property for the manifest class-path. The compile target refers to project.class.path There is redundancy here, because jar.class.path and project.class.path are very similar. They must be both updated when libraries are added, which can be a pain if the list of libra...

Is it possible to view what shell commands Eclipse is making?

I have a rather length project I'm working on, which requires an older JDK to compile correctly, various JAR includes, and the like. I'm assembling the entire project using a batch script, and I'd like to make the whole process fully automated with the script. So I was wondering if I could view the shell commands Eclipse does to make a p...

Using ANT to generate a .jar in a very large project

Hi, I have a large project I'm working on (using Eclipse) that uses the 1.5 update 18 JDK, various external JARs, and the like. It's all been setup properly in Eclipse. Is it possible to create an Ant file that generates a JAR from a particular source file in my project? (A number of the source files are compilable into Java Applications...

Help with automating large project compiling.

Hi, I'm working on an automation project for my employer. We have a pool for each revision of our source code. When you download a revision, you need to create a directory structure with a bunch of third party includes to eventually build the project. I've automated this entire process up to the point of having my script (.bat) compile e...

From within the Eclipse IDE, how can I show a list of types that exist in a jar?

I'm rediscovering Java, and I'm a little lost about how to do this within Eclipse. I am looking sort of for Visual Studio "object browser" functionality, but I'd settle for a quick list of types that are defined within my referenced external jar files. ...

getResourceAsStream not working for every class?

Hi, I have a jar file that uses some txt files. In order to get them it uses Class.getResourceAsStream function. Class A { public InputStream getInputStream(String path) throws Exception { try { return new FileInputStream(path); } catch (FileNotFoundException ex) { InputStream inputStream = getClass().getResou...

How to detect duplicate JARs in the classpath?

Does anyone have code to detect duplicate JARs in the classpath? Background: When there are two versions of the same JAR in the classpath, really strange things can happen. This can even happen when using tools like Maven: Change a dependency and build the WAR without cleaning first. Since target/webapp/WEB-INF/lib wasn't cleaned, the d...

Strange/simple batch question regarding Java/Ant

For my company, I'm making a batch script to go through and compile the latest revisions of code for our current project. I'm using Ant to build the class files, but encountered a strange error. One of the source files imports .* from a directory, where there are no files (only folders), and in fact, the folders needed are imported right...