Compiling java -

Using the Java SDK with TextPad

Moderators: AmigoJack, helios, bbadmin, Bob Hansen, MudGuard

Post Reply
brunojac@googlemail.com
Posts: 2
Joined: Tue Nov 18, 2008 9:52 am
Location: Belgium

Compiling java -

Post 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
brunojac@googlemail.com
Posts: 2
Joined: Tue Nov 18, 2008 9:52 am
Location: Belgium

Issue solved

Post 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:
mpugliese
Posts: 1
Joined: Wed Jan 26, 2011 3:19 pm
Location: Arvada, CO
Contact:

configure jar files within TextPad

Post 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.
M. Pugliese
Post Reply