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
Compiling java -
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 2
- Joined: Tue Nov 18, 2008 9:52 am
- Location: Belgium
-
- Posts: 2
- Joined: Tue Nov 18, 2008 9:52 am
- Location: Belgium
Issue solved
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).
Solved (and without changing anything to the classpath setting).
configure jar files within TextPad
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.
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