classpath

Maven - how can I add an arbitrary classpath entry to a jar?

I have an unusual situation where I need to add an arbitrary classpath entry (that points to a jar file) into the manifest of an executable jar. (This is for a Swing desktop application.) The maven-jar-plugin generates the "Class-Path" entry for the jar manifest using the maven dependencies, and there doesn't appear to be any way of add...

java -- compiling with a .Jar file -- help?

Hey, I'm trying to compile my class along with a provided .jar file which contains classes that my class will use. This is what I've been trying: javac -classpath .:WordSearch.jar WordSearchSolver.java And this is the response: WordSearchSolver.java:16: cannot find symbol symbol : class PuzzleWord location: class WordSearchSolver ...

How to connect SQLite with Java?

Hi, I am using one simple code to access the SQLite database from Java application . My code is import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class ConnectSQLite { public static void main(String[] args) { Connection connection = null;...

eclipse and path

Hello I have written a such function under Eclipse: public static ArrayList<String> getMails(){ ArrayList<String> mails = new ArrayList<String>(); try{ FileInputStream fstream = new FileInputStream("mails.txt"); DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedRea...

Writing a Java standard class library alternative from the scratch

Hi, I am just curious but I want to know if it is feasible to remove totally the Java standard class libraries coming with the JVM and start a new one from the scratch [à la ClassPath]. If that is possible, what classes MUST be implemented as minimum? (Object and String come to my mind, but... I do not know). Such thing breaks some li...

Java packaging issue

I have an application that I've developed. Currently it is deployed with all its config files (including log4j.properties, as used by some external libs I use) in the same dir as my application. So, I have a bin dir, containing my app.jar, plus a few properties files, plus a lib dir with all my external jars. The external jars are speci...

Why does ANT tell me that JAVA_HOME is wrong when it is not?

I get the error: C:\dev\ws\springapp\build.xml:81: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:\Program Files\Java\jre6" But I have clearly set my JAVA_HOME to be C:\Program Files\Java\jdk1.6.0_14 Where is ANT getting this va...

ClassNotFoundException for class file on classpath

Hello all! I have the following code: // Test TODO remove try { System.out.println(System.getProperties().getProperty("java.class.path")); this.getClass().getClassLoader().loadClass("mypackage.MyClass"); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } Now the output shows me,...

Problems with setting the classpath in ant

Hi, I'm having problems getting my Java program to run (it uses some third party .jar s). I can compile it fine but when I call my run target in ant it says it can't find the class that I told it run in the classpath. Here's what my build.xml looks like: <project basedir="." default="build"> <property name="build" value="build" /> <prop...

Flex and CS4 and CS3 projects

Hi, I'm working on a project that was created using flex and CS3. I only have access to CS4 and the class paths normally located at: C:/Documents and Settings/wturrin/Local Settings/Application Data/Adobe/Flash CS3/en/Configuration/Classes are nowhere to be found. I tried setting up links to the localSettings/Application/Adobe/Flash ...

Eclipse classpath does not update changes in Project Properties

I am using Eclipse 3.4.1 Build M20080911-1700 I have tried to change the classpath directories for jar and the source directory using the Project Properties -> Java Build Path -> Libraries Tab or Source Tab. When I click OK button and then return to the properties page, my changes were not applied. I have to resort in the work around ...

Putting Eclipse plugin on System classpath

I am trying to desrialize an object of type A located in plugin C. Although my plugin has the proper dependency on plugin C which has type A and can also create and instantiate an object of type A, when I try to desiralize an object of type A, it fails. The reason I believe is that the java.io.* classes which are actually doing the d...

Add items to application (WAR) classpath in WebLogic 10?

My shop has been running Oracle's Application Server for several years. As such, before we knew better, we have developed a norm of having application config files stored outside of the WAR file and the app-specific config directory is added to each application using an Oracle-specific deployment descriptor. This deployment descriptor al...

Tomcat's CLASSPATH is different than Java's, and it does not include "." How do I change it?

I've been spending hours trying to figure out why I've been getting the java.lang.NoClassDefFoundError, and I've narrowed down the cause to Tomcat's classpath. I used the code below to see what the path variables hold: out.println("Classpath: '" + System.getProperty( "java.class.path" ) + "'" ); out.println("Ext dirs: '" + System.getPr...

Adding to the classpath on OSX

Can anyone tell me how to add to the classpath on OSX? ...

Glassfish doesn't load jdbc

I've a application in swing and ejb3 inside glassfish v2ur2 and until one week ago all was ok. in sometime, the glassfish never more load the jdbc driver of postgresql and the connection with the bd fail, but the jdbc driver is in the project and in the classpath. the only way to fix it was put the jar inside lib folder of glassfish doma...

ClassNotFoundException

I'm getting the following error when I try to run a Java class which interacts with Java DB. I try loading driver with : Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); In libraries, "derby.jar" do exist. I'm using NetBeans IDE 6.0. Could anyone help me to solve this problem? ...

Ivy, ant and start scripts

Hi all, I have a project that uses ant to build and ivy for dependencies. I would like to generate the start scripts for my project, with the classpath, based on the dependencies configured in Ivy, especially as the order of dependencies may be important and needs to be preserved from the order in the ivy config. Has anyone done this ...

How to include the lib folder in the manifest classpath in Netbeans

Hi, A library that my java application uses needs looks for a file (log4j.xml) in the class path. I use netbeans to manage my project, but I can't find a way to include the lib/ folder. Netbeans automatically creates a MANIFEST.MF file inside the application jar and also creates a folder called lib/ which includes all dependencies. Thi...

Can I use the classpath to override a file in a jar that is being run?

I have a JAR file that contains an application as well as configuration files for that application. The application loads configuration files from the classpath (using ClassLoader.getResource()), and has its dependencies completely satisfied using the configuration files baked into the JAR file. On occasion I want the application to be ...