Page 1 of 1

Compiling java -

Posted: Tue Nov 18, 2008 10:05 am
by brunojac@googlemail.com
I have a small java project that imports some classes from a jar file.
import X.Y.Z.*;

Both the java source file (UserInfo.jar) and the jar file (customer.jar) are located in the same directory.

This compiles fine with the sandard javac command:

javac -d . -classpath customer.jar UserInfo.java

However this fails in textpad:

C:\Bruno\Dev\java\UserInfo.java:13: package X.Y.Z does not exist
import X.Y.Z.*;

Any suggestion ?

Many thanks !

I checked the PATH env setting, the current directory is apparently included:
.;C:\PROGRA~1\IBM\SQLLIB\java\db2java.zip;C:\PROGRA~1..... :? etc

Issue solved

Posted: Tue Nov 18, 2008 5:20 pm
by brunojac@googlemail.com
Added the java jar file (customer.jar) to C:\Program Files\Java\jdk1.6.0_10\jre\lib\ext directory.

Solved (and without changing anything to the classpath setting).

:oops:

configure jar files within TextPad

Posted: Wed Jan 26, 2011 3:28 pm
by mpugliese
Rather than copying jar files into a the Java lib directory you can configure everything directly through TextPad. To do this you need to set the TextPad tool preferences to recognize that a jar file will be included during compilation and execution.

The preference settings are accessed through the Configure drop down menu. You then click on preferences. Expand the tools list and highlight the Compile Java item.


To include a jar file, such as DanceStudio.jar, you need to change your compile parameters in TextPad to this:

-classpath .;DanceStudio.jar $File

You also need to copy the jar file into the same directory as the other java classes that you are trying to compile.

When running your application or applet, you must set your run parameters in TextPad to this:

-classpath .;DanceStudio.jar $BaseName

This enables the executing class to find all necessary compiled files in the jar file.