jar

Is there some easy way to execute code upon JBoss deployment of a JAR inside an EAR?

I plan to deploy an EAR packaged application into JBoss v4.2 as a folder containing the content of the EAR. Until now the EAR is deployed as a single file. I hope to be able to replace single JARs without the need to restart the application. Is there any kind of event listener or annotation that can be used to register those JAR files u...

Where eclipse stores information about jars associated with a Library

I've written an ant task that extracts the classpath of a project form eclipse's .classpath file - so I don't need to maintain the project's dependencies both in eclipse and in my ant file. This ant task works great and it makes my compilation ant scripts to be very elegant, short, and the most important thing maintainable. In Ecli...

Can you access items inside a jar using File

I have some files inside a jar which I would like to access in Java using a File object rather than as a stream. Is it possible to do this? ...

Manage dependencies in a Play Framework app

Hi, I'm trying to figure out the proper tools for managing dependencies between JARs. I have a Play Framework app, which imports a JAR (based on another project I'm writing). This JAR imports other JARs, some of which have dependencies for yet other JARs. This far, I've gotten by with adding stuff to the build path in Eclipse. But when...

How to add the ojdbc jar to my project and use it

I need some help with the eclipse. I have a project which need to connect to oracle databases so i have the ojdbc jar file and a simple project. try { Class.forName("oracle.jdbc.driver.OracleDriver"); Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@"+this.host+":"+this.port+":"+this.db,this.user,this.pa...

modify properties file in META-INF

I'm using maven and storing a properties file in src/main/resources which I can read fine like: properties.loadFromXML(this.getClass().getClassLoader(). getResourceAsStream("META-INF/properties.xml"); Is it possible to then write to this file when it is packaged up as a jar? I've tried the following: propertie...

How to pass options to a jar file using Netbeans

Hello, I need to be able to pass option flags to Java when my users execute a given Jar file. I am using Netbeans as my IDE and it would be nice if I could set it somewhere inside there to avoid manually changing each jar file to do this. I know under the project if you right click, go properties, then run, you can set options there b...

[Blackberry] Error preverifying class

Hi, I'm developing a blackberry unit test application (JDE 4.6.1 on windows machine). My workspace is composed by 2 project UnitTest and MyApp. The UnitTest project references the MyApp one ( I added MyApp in the UnitTest Java Build Path). Unfortunately when I try to build it I receive this message: Executing rapc for the project bUn...

How to add external jar libraries to an android project from the command line

I'm trying to build an Android project that has some dependencies. The jar files are in the lib/ directory. I can build the project by adding those jar file to my classpath, but of course it Force Closes in the emulator because those libraries aren't present. I'm doing this from the command line with ant (not in eclipse). How can I m...

Create on single .JAR with no lib folder

I am using netbeans to develop a project. My project also depends on the javaMail files which I added using Netbeans libraries. When I build the project I get a dist folder under which is my jar file and a lib folder. I want to distribute the project simply to my users and want to some how wrap the lib contents into the project jar fi...

creating a jar for a project in Eclipse

I am using Eclipse and I have just started working on a project that needs another project (say pjkt) to function. The pjkt project files are stored in a specific folder. I would like to create a jar from pjkt and then add this jar to my project buildpath. How do I do this? Do I need create first in Eclipse a new project from the pjkt co...

"Launch Configuration" Shows up Blank When Trying to Export Runnable Jar?

Hey everyone, I've gotten this to work in the past, but now whenever I choose File > Export... > Runnable JAR File and select the drop-down menu "Launch Configuration", all I get is a blank bar. How can I get my main class to show up? Many Thanks, Justian ...

Text-based loading bar when running Java in command prompt?

Hey everyone, I was just wondering if there was a way to use System.out.println(); or other methods to create a cool loading bar when I run my program with a batch file. The real question here is how I can make this bar appear as if it's printing on only one line. I don't want it to be spread over multiple lines like below: [aaaaaccc...

Copy a jar archive to file system with structure intact with Java

I have a program that runs from an executable jar. It has external dependencies such as xml files. I have created a jar full of resource xml files and placed it within the XML file and with a click of the button within the program I want all of those xml files and the folder structure to go along with it to be created at a user defined d...

Classpath variable in java

I'm reading a few files in my application and referring to them as new File("src/main/resource/filename") and it works. But when I package the jar with the Maven assembly plugin and run java - jar I get an error, naturally: Error occured: src\main\resources\UPDATE.txt (The system cannot find the path specified) Because there is no ...

Export Non-executable jar in Eclipse with Reference Libraries

I have a project in Eclipse which I would like to export into a jar. However, this code is only generic helper code I use on many projects and would like to have wrapped up nicely, so I do not want to create an executable jar. My code relies on two referenced libraries, but it seems that the non-executable jar export feature in Eclipse d...

how to list the contents of a jar file inside a war file

Lets say I have a .war file myWarFile.war This file has a jar file inside it - WEB-INF/myJarFile.jar I want to see what are the files inside myJarFile.jar without extracting the war file. Is there a way to do it? ...

Program stopped working after creating a .jar file with Netbeans

I made a simple Swing application with some database connectivity, using Notepad++ and executing it from the command prompt. It was executing perfectly. Then I copied all of the code to Netbeans and tried to build to main project, in order to package my application as a .jar file. A .jar file was created successfully, but when I trie...

How to include a external jar in a GWT (Google Web Toolkit) project?

I have a external jar file named "xxx.jar". I use "xxx.jar" in my GWT project. When I attempt to build the JavaScript version of my project in Ant, I get one of the following type of errors at every location in which I use xxx. I get a error of this kind when doing the "gwtc" task in Ant, the javac compilation process proceeds just fine...

Executing .jar file from PHP through Command prompt

Hi, I have a .jar file which has a command line interface. I want to call the jar file through command prompt and capture the output of the Jar file. I have tried with the exec() command. The command I have used is: <?php exec('java -jar D:\\Development\\Filehandler\\dist\\Filehandler.jar \ getConfigLang', $result); echo $result; echo...