6 Replies - 1912 Views - Last Post: 31 March 2007 - 02:36 PM Rate Topic: -----

#1 Israel  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 7
  • View blog
  • Posts: 818
  • Joined: 22-November 04

Linking New Packages to Java Project

Posted 27 March 2007 - 09:46 PM

I've been getting sick trying to do this. I'm sure it's simple I just can't find much on it. I'm just trying to link a package I downloaded (didn't come with JBuilder or jdk) to a java project. I can't find anything on how to do this with JBuilder but here is what I'm trying with jdk:(Ps - I'm using Linux, I know the snytax is a hair different for this)

Me@3[MyBot]$ javac -classpath pircbot.jar:. *.java
bash: javac: command not found
Me@3[MyBot]$ javac -classpath /home/Israel/MyBot/pircbot-1.4.4/pircbot.jar:. *.java
bash: javac: command not found
Me@3[MyBot]$ javac -classpath ./pircbot.jar:. *.java
bash: javac: command not found
Me@3[MyBot]$ javac -classpath ./pircbot-1.4.4/pircbot.jar:. *.java
bash: javac: command not found
Me@3[MyBot]$ javac -classpath pircbot-1.4.4/pircbot.jar:. *.java
bash: javac: command not found
Me@3[MyBot]$ ls
MyBot.java  MyBotMain.java  org.jibble.pircbot.*  pircbot-1.4.4
Me@3[MyBot]$ cd ./pirc*
Me@3[pircbot-1.4.4]$ ls
javadocs  pircbot.jar
Me@3[pircbot-1.4.4]$ javac -classpath pircbot.jar:. *.java
bash: javac: command not found
Me@3[pircbot-1.4.4]$ javac -classpath ./pircbot.jar:. *.java
bash: javac: command not found
Me@3[pircbot-1.4.4]$


If you can't tell, the package I'm trying to link is located at /home/Me/MyBot/pircbot-1.4.4/pircbot.jar

Is This A Good Question/Topic? 0
  • +

Replies To: Linking New Packages to Java Project

#2 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 205
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: Linking New Packages to Java Project

Posted 27 March 2007 - 10:49 PM

i'm not familiar with linking in .jar files, most often this is done with .class files then the jar is made of the whole package. How are you adding the package, it MUST be the first line, no comments or otherwise can go before.
Was This Post Helpful? 0
  • +
  • -

#3 Israel  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 7
  • View blog
  • Posts: 818
  • Joined: 22-November 04

Re: Linking New Packages to Java Project

Posted 27 March 2007 - 11:25 PM

Well, I'm trying to add it through the commands above. I downloaded the package and got the commands I've used from this site. I have pretty much followed their instructions to the tea. Maybe seeing the actual package would give you more insight to my problem. :blink:
Was This Post Helpful? 0
  • +
  • -

#4 Thorian  Icon User is offline

  • Pirate Medic
  • member icon

Reputation: 22
  • View blog
  • Posts: 5,904
  • Joined: 06-June 02

Re: Linking New Packages to Java Project

Posted 28 March 2007 - 08:30 AM

I am going to move this to the Java forum it may get better results there.
Was This Post Helpful? 0
  • +
  • -

#5 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: Linking New Packages to Java Project

Posted 28 March 2007 - 09:10 AM

Looking at your errors, I think the main problem is that javac is not found, otherwise it should work.
Can you compile a simple application on the command line?
If not add the java directory to the path.
Later you might have a look at Apache ant, or make to make your life easier, but first sort out the path problem.
Was This Post Helpful? 0
  • +
  • -

#6 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 205
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: Linking New Packages to Java Project

Posted 28 March 2007 - 10:55 AM

i've had similar problems with the updates to java, javac isn't always found on the command line, i have yet to figure our why, or some constant way to make it work.
Was This Post Helpful? 0
  • +
  • -

#7 Israel  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 7
  • View blog
  • Posts: 818
  • Joined: 22-November 04

Re: Linking New Packages to Java Project

Posted 31 March 2007 - 02:36 PM

Ok, I got that straightened out with the jdk and javac, but I'm still having trouble linking that package...

root@2[bin]# ./javac
Usage: javac <options> <source files>
where possible options include:
  -g						Generate all debugging info
  -g:none				   Generate no debugging info
  -g:{lines,vars,source}	Generate only some debugging info
  -nowarn				   Generate no warnings
  -verbose				  Output messages about what the compiler is doing
  -deprecation			  Output source locations where deprecated APIs are used
  -classpath <path>		 Specify where to find user class files
  -sourcepath <path>		Specify where to find input source files
  -bootclasspath <path>	 Override location of bootstrap class files
  -extdirs <dirs>		   Override location of installed extensions
  -d <directory>			Specify where to place generated class files
  -encoding <encoding>	  Specify character encoding used by source files
  -source <release>		 Provide source compatibility with specified release
  -target <release>		 Generate class files for specific VM version
  -help					 Print a synopsis of standard options

root@2[bin]# javac -classpath pircbot.jar:. *.java
bash: javac: command not found
root@2[bin]# javac -classpath /home/Me/MyBot/pircbot-1.4.4/pircbot.jar:. *.java
bash: javac: command not found
root@2[bin]# javac -classpath /home/Me/MyBot/pircbot-1.4.4/pircbot.jar:.
bash: javac: command not found
root@2[bin]# javac -classpath /home/Me/MyBot/pircbot-1.4.4/pircbot.jar:
bash: javac: command not found
root@2[bin]# javac -classpath pircbot.jar:. /home/Me/MyBot/pircbot-1.4.4/
bash: javac: command not found
root@2[bin]#			   
root@2[bin]# ./javac -classpath pircbot.jar:. *.java
error: cannot read: *.java
1 error


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1