Community
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compiling java -

 
Post new topic   Reply to topic    Community Forum Index -> Java
View previous topic :: View next topic  
Author Message
brunojac@googlemail.com



Joined: 18 Nov 2008
Posts: 2
Location: Belgium

PostPosted: Tue Nov 18, 2008 10:05 am    Post subject: Compiling java - Reply with quote

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..... Confused etc
Back to top
View user's profile Send private message
brunojac@googlemail.com



Joined: 18 Nov 2008
Posts: 2
Location: Belgium

PostPosted: Tue Nov 18, 2008 5:20 pm    Post subject: Issue solved Reply with quote

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).

Embarassed
Back to top
View user's profile Send private message
mpugliese



Joined: 26 Jan 2011
Posts: 1
Location: Arvada, CO

PostPosted: Wed Jan 26, 2011 3:28 pm    Post subject: configure jar files within TextPad Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Community Forum Index -> Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB