Results 1 to 6 of 6
- 06-15-2010, 03:17 PM #1
Member
- Join Date
- Jun 2010
- Posts
- 1
- Rep Power
- 0
Use hard path to jar file instead of copy
Hy all,
I 'm relatively new to Java and have this problem I can not solve.
Made an application that uses the JMF library (Suns Java Media Framework). To have it working i have to use the jmf.jar file in the JMF instalation directory (Can not copy this one, than it does not work).
Now when I run the project it works!!
.. BUT..
When I build the project NetBeans copies the jmf.jar to a lib dir and points the class-path in the manifest to that location. Now it does not work.
I tried fooling around with the manifest file but no success.
I used this syntaxes like C\:\\Program Files\\JMF2.1.1e\\lib\\jmf.lib
I'm really stuck. Now my question is: How can I tell java or NetBeans or Ant to use an already installed directory as library?
- 06-15-2010, 04:00 PM #2
Have you tried copying the jar files to a work/temp directory, opening a command prompt in that directory and issuing a java command to execute your program and have all the jar files on the classpath?
java -classpath jar1.jar;jar2.jar;jar3.jar;yourpgms.jar path.Main
This method gets away from using any part of the IDE.
- 06-17-2010, 03:30 AM #3
you just have to include the required JMF classes to your project jar and leave alone the JMF lib jar file at all :)
+ 1 my REP
Good Luck :)
- 06-17-2010, 01:31 PM #4
Copy class files from one jar file to another can be a problem.
Do any of the IDEs do it for you?
- 06-18-2010, 03:18 AM #5
there should be an IDE function to include required resources. What IDE do you use?
+ 1 my REP
Good Luck :)
- 01-14-2012, 07:27 PM #6
Member
- Join Date
- Jan 2012
- Posts
- 32
- Rep Power
- 0
Re: Use hard path to jar file instead of copy
Gonna try to resurrect this topic. I have a problem that I think that has something to see here. I'm now working on sound playing. For that purpose, I'm using JMF. I've already installed it, and choosing all and everyone of the recommended options while installing (like auto-updating CLASSPATH, for example). After compiling my class AudioSample, indicated in the IBM DeveloperWorks tutorial for JMF with the javac command, if I try to run it from the command line it works perfect. But that's not what I want. I need it to be able to run from inside my IDE, because I want to include in a library, what of course implies building it as a .jar. The problem is that it doesn't work when I run it from my IDE because the .jar doesn't work (if I double-click it, it doesn't work). So, as expectable, I get an error when I try to run a sound file from that library:
Unable to handle format: LINEAR, 48000.0 Hz, 24-bit, Stereo, LittleEndian, Signed, 288000.0 frame rate, FrameSize=48 bits
Failed to prefetch: com.sun.media.PlaybackEngine@7259da
Error: Unable to prefetch com.sun.media.PlaybackEngine@7259da
So please I'd need some help. I've already tried adding some stuff to classpath but it doesn't work. I'm using Netbeans IDE and this is the structure of my project:
Attachment 2648
Similar Threads
-
Copy file from 1 dir to another dir of the same system
By newjava in forum New To JavaReplies: 5Last Post: 12-23-2009, 11:36 AM -
How we can copy the component of a jtextarea into a file??
By kostinio in forum AWT / SwingReplies: 10Last Post: 10-30-2009, 11:15 PM -
Signed Java Applet to read a file on hard drive?
By ollyworks in forum Java AppletsReplies: 2Last Post: 09-11-2009, 10:08 PM -
Copy a file to a folder.
By leric in forum New To JavaReplies: 7Last Post: 07-29-2009, 05:11 AM -
java file copy
By hknyo in forum New To JavaReplies: 1Last Post: 06-12-2008, 04:42 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks