Need help compiling external jar files into my one jar file from cmd line

Here is my problem, let me see if I can explain it right:
I am making a jar file on my development computer that will run my java project. In this java project, it references a couple Java3D jar files. On my development computer, I create the jar file and it runs correctly, but when I move that jar file over to the test computer, the parts of the application needing those Java3D jars are not found in my jar I created. I isolated the problem and it is because those Java3D jar files I needed are not on my test machine. But that is the way I need it to be. I need it so that when I compile all my code on the development machine, I need it to also compile those two Java3D files into my one jar that I move to the test machine. You get what I'm saying? I must do all the compiling from the command line and have only one jar file to put on the test machine that contains all my compiled code and the two Java3D files needed to run some of the applications in the project.
Here a brief sample of what I'm doing:
To compile my java files in my project, I simply to this for all my files:
javac file.java
javac file2.java... and so on for all my java files.
Then I create my jar file:
jar -cfm MyJar.jar manifest.mf file.class
jar -fmu MyJar.jar manifest.mf file2.class... and so on for all my class files.
Also when compiling my jar file, I do this thinking that it would include the two Java3D jars into my one jar file:
jar -fmu MyJar.jar manifest.mf jars/j3d-org-images.jar
jar -fmu MyJar.jar manifest.mf jars/j3d-org.jar
My manifest file looks something like this:
Manifest-Version: 1.0
Main-Class: Main
Class-Path: jars/j3d-org.jar jars/j3d-org-images.jar
Do I have to have that Class-Path in there pointing to those jar files? Those jar files will not exist on my test machine because the directory structure will not be the same. I've tried a manifest without specifying my Class-Path to those jar files, but I get the same problem when I run my application on the part that needs the Java3D files.
The error I am getting is that there is a RasterTextLabel class inside one of those Java3D jar files that my application cannot access because those jar files are not on my test machine.
So basically what I really need to know is how I get those two Java3D jar files compiled into my one jar file that I move to a test machine and run with the following command:
java -jar MyJar.jar
Can anyone help me??
Thanks.

Here what you need is to have all the files present in a single jar file, and the classpath is set properly to the required jar files.
Do the following in steps:
1)
Create a custom manifest file,say mymanifest.mf, with the following contenets, put it in current directory:
Manifest-Version: 1.0
Created-By: 1.4.0_01 (Sun Microsystems Inc.)
main-Class: Main
Class-Path: jars/j3d-org.jar jars/j3d-org-images.jar <press ENTER key>
2)
jar -cfm MyJar.jar manifest.mf file.class
jar -fmu MyJar.jar manifest.mf file2.class... and so on for all class files.
3)
jar -fmu MyJar.jar manifest.mf jars/j3d-org.jar
jar -fmu MyJar.jar manifest.mf jars/j3d-org-images.jar
(Make sure that j3d-org-images.jar and j3d-org.jar are present in a subdirectory called 'jars')
Now you would be able to run,
java -jar myjar.jar

Similar Messages

  • Need help combining multiple audiobook cds into single mpeg file for Ipod

    I have been unable to find an application that will let me combine multiple MPEG audio files into a single MPEG file. My goal is to combine several CDs from an audiobook into a single file so that I can listen to it on my Ipod. Also, it would take up a lot less space as an ITunes listing. Mediajoiner was recommended on some other forums, but I could not find a version that worked with OS X and Java 1.5.
    Any help is appreciated

    [MP3Trimmer|http://www.deepniner.net/mp3trimmer>

  • Need help " Can't find a valid editor for this file extension" not sure why I am getting and this or what to do.

    also say explorer not reading SWF files and I have to reload them? Not sure what that is either,
    Thanks
    Jim

    Hi Nancy
    Trying to update my site got to make some changes.  Do you work on sites via remote? I am on Cloud.
    : Nancy O. 
    Sent: Monday, September 01, 2014 3:47 PM
    To: James Neidner
    Subject:  Need help " Can't find a valid editor for this file extension" not sure why I am getting and this or what to do.
    Need help " Can't find a valid editor for this file extension" not sure why I am getting and this or what to do.
    created by Nancy O. <https://forums.adobe.com/people/Nancy+O.>  in Dreamweaver support forum - View the full discussion <https://forums.adobe.com/message/6692200#6692200>

  • Again,HOW to conver a .class file into .java one?

    sorry , but Can't u send me a specific link for downloading this "Java decomplier"??
    coz I found my self in something called (jad decompiler) with lots of versions and this is confusing
    and Is that mean, that there's a decompiler which can convert the .class file into .java one?
    and thanks alot man.....u help me always!
    (I'm still begginner in java)

    Just to emphasise what yawmark said...
    Decompiled java code is NEVER going to be as clear as well-written original java source code. The decompiler can see what the compiled code does but not why or what it means, so the source code that the decompiler produces is going to be ugly and hard to read. Decompilers are really only useful for experienced programmers who know what to infer, how to read between the lines...
    If you need help writing something, then you're better off looking at tutorials. In tutorials the code will be well-commented.

  • Source code organization: How to divide large JavaScript files into several smaller JavaScript files?

    Hello,
    some of my JavaScripts have become considerably large over time. What I would like to do is to split a single (large) JavaScript source file into several smaller source files plus an additional JavaScript file containing code or directives to recombine the split files.
    In other words, I would like to organize my JavaScript source code into re-usable modules.
    Although I searched the Acrobat JavaScript developer documentation and did a lot of Web searching, I still have no idea...
    whether the Acrobat JavaScript scripting environment itself does provide a code structuring mechanism
    how to properly organize large Acrobat JavaScripts in general.
    Any help would be greatly appreciated! Thanks a lot in advance!
    Sebastian

    Document-level scripts are not accessible to other documents/scripts, so they're not a good option.
    Folder-level scripts, on the other hand, are accessible to all other documents/scripts. So if you have a general function that creates a 3D annotation, for example, you can place it in a folder-level script and then call it from other scripts (you will probably need to provide it a handle for the document and properties of the annotation).
    One thing to be aware of, though, is that the folder-level scripts are loaded alphabetically, so don't put a reference in script aaa.js to something that loads in zzz.js, or you will get an error message when you open Acrobat. (this is not a problem if zzz.js is not called during the launch of Acrobat)

  • How to Combine multiple files into the one file?

    Hi all,
    How do I combine multiple canon hf10 avchd files into the one file with a new extension. No need to be compressed.
    Afterwards, I also want to split this combined file to original files.
    Need Help!

    Yes, angelanna. You can merge or split your video file via FCP sequence.
    ahaah, maybe I think angelanna would like to get the resulting file with MTS format because he mentioned “No need to be compressed”. Are you asking for this, angelanna?
    If so, a simple MTS files managing and editing tool  is needed. Maybe you can have a try the Mac version of Aunsoft Final Mate for managing HD camcorder footages. I just downloaded its free trial version and it offers a simple way of garping footages directly  from camcorder. And also it provides a attractive feature to join flawlessly and split accurately native MTS files for video file output with original MTS format.
    Maybe this is the tool cwhich an help you out, angelanna.
    Enjoy your video.

  • I'm trying to write an Applescript: when I add a file to a folder, I want finder to name it "1" and increment the other files in the folder by 1. i.e. once I drop a new file into the folder, the file originally called "1" will be renamed "2" etc

    I'm trying to write an Applescript. I have never used Applescript but my boss has just asked me to write a script so I dutifully nodded and said "Yes Boss"...
    The funtionality I need is that I want finder to rename the files in folder when I drop a new file in. When I add the new file (file neame: "1") to a folder, I want to increment the other file names in the folder by 1.
    So when I drop a my new "1" file into the folder, the file original file called "1" will be renamed "2", the original file named "2" will be renamed "3" etc
    I'm creating a 'stream' of images. When I add a new image i want it to nudge the other images in the folder along.
    Thanks guys!

    Maybe this will help. If you monitor the "More Like This" box (top right), other threads appear. Opening them usually displays other threads.
    https://discussions.apple.com/message/1986834#1986834

  • How do i combine multiple pdf file into a single pdf file?

    how do i combine multiple pdf files into a single pdf file?

    The thread was started in early March and it's Mid-April, I know this very well. The OP of this thread posted a very common and simple question or maybe he/she would have resolved this. For an Adobe Acrobat user it's not at all difficult to combine multiple PDF files into one. But to combine PDF files full version of Adobe Acrobat is mainly required, otherwise PDF files can't be combined. For example, I'm using Adobe Acrobat 9 Pro. These simple steps are mainly required to combine PDF files:
    Open Adobe Acrobat.
    Click on Combine and click on Merge files into a single PDF.
    A window will be appearing, click on Add Files and select the PDF files you want to combine.
    Arrange the selected files in any order with the help of Move Up and Move Down button.
    Now click on Combine File and the selected PDF files will be combined within a few seconds.
    A new PDF file will be created. Click on Save As and name this new PDF file. Then, click on Save.
    A new PDF file will be created and all the selected PDF files are combined in it. The steps shown above might be different in other versions of Adobe Acrobat. Other than this, some third-party PDF merge software are also available. Most of them are available with a demo version for free evaluation. I've heard much about SysInfoTools PDF Merge software on other forums and directories and it's demo version is freely available. One may check its demo version if Adobe Acrobat (full version) is not available.
    Regards

  • How to transfer input file into XI through sender file adapter

    Hi
    I am quite new to XI. Want to know how I can transfer a file into XI through sender file adapter. I dont have any input file, so I have to create a sample input file and I want to transfer that into XI. Can you please advise me of the steps involved in that. I have finished work in design and directory, now I want to push file the sample file into XI. The receiver adapter is an IDoc adapter. And also a very trivial question. How I can place my sample file into my source directory. Thanks

    Hi Rajiv,
    If your transport protocol is NFS then you need to put the file in the XI server. Because it becomes the Network File System. For that you can just type the ip address of the XI server in the "run" command or in the browser with "
    " then in any of the Folders you can paste your file. But ensure that this is the path you give in your Sender File Adapter.
    If your transport protocol is FTP then you need to see that ftp is running in your system. for that go to Control Panel>Add/Remove Programs>Add/Remove Components. In that check the IIS server and go to details and see that ftp is also checked. Now ftp is running in your system.
    Now open your C:> drive >InetPub>ftproot . and create a folder here and paste your file. In the configuration of your File sender adapter just mention the name of the folder.
    For your information, you can create a file with xml tags and namespace and message type manually (or) you can directly get it from the test tab of message mapping and generate source code.

  • I need help.  Can LiveCycle PDF Generator accept network print jobs from a PCL only source?

    I need help.  Can LiveCycle PDF Generator accept network print jobs from a PCL only source?

    More information about this game:
    The game should generate a random obstacle course for the player. The first column of the grid, however, should consist of all empty pieces, with the exception of the upper left-hand corner, which is the grid location where the player initially resides.
    Enter a loop in which the following things happen (not necessarily in this order):
    Print the current board configuration. Additionally, a key should be printed describing what each piece is.
    Get an action from the user. The player can move up, down, left, or right. Use the following controls: up = 'i', down = 'm', left = 'j', right = 'k'. The player can move at most one block at a time. Of course, if the player tries to move into a spot occupied by an immovable block, the player will not move.
    Inform the player whether they have won, or if they have lost (a player loses if they step on a bomb piece).
    If the player types 'q', the game should terminate.
    I am still stuck on this maze generator stuff.... Please help me....

  • My mac is converting Word and Excel files into Pages and Numbers files when I click to open them (or download and open them) from an email. I do I get this to stop? It's really aggravating.

    My mac is converting Word and Excel files into Pages and Numbers files when I click to open them from an email. Downloading them and opening them doesn't help. How do I make this stop? I don't use iLife and don't want to; my clients are using Office and it's easier for me, except when I have to copy and paste everything they send me from an iLife file back to Word and Excel. Help!!! It's like Apple has become Microsoft, forcing us to use their apps.

    Do you have Word & Excel installed, if yes, navigate in the finder to an example of each, right click and select 'Get Info' scroll down to 'Open With' and select the appropriate program, check the box that says 'Change All'

  • Convert Windows Excel File into a Mac Excel File

    I have transferred my Workout Journal spread sheet over from my girlfriends PC (which I use often) . Problem is, I can't access it the file on my Mac in Excel or Numbers. It's currently in .xlsx format, I tried simply renaming as an .xls file but it wouldn't open properly on either application.
    How do I convert this file Windows file into a Mac readable file. Thanks
    All help appreciated

    You cannot read Excel ".xlsx" form files using older versions of Microsoft Excel than the 2011 version of Office for Mac or at all in Numbers.  You will either have to Upgrade your version of Excel on your Mac to "Office for Mac 2011", OR go back to your girlfriend's computer and resave the file using "Save As ..." and there select the ".xls" compatibility format instead of the default ".xlsx" version that the newer versions of Excel use.

  • Is there a quick method for turning a 13 page Ai file into 13 separate Ai files

    Is there a quick method for turning a 13 page Ai file into 13 separate Ai files? I need to resave or RIP them as normalized PDF files, and I need to start with single-page ai files.
    Thanks.

    As Erica says, it's in the Illustrator Options window which opens after checking Save.. Check the top of what I showed

  • Acrobat XI PRO: Create a Table of Contents (TOC) automatically in top, after I have combined several pdf.files into a single pdf.file

    Hey
    I have now tried for hours, but now I give up!
    MY WISH -
    Create a Table of Contents (TOC) automatically after I have combined several pdf.files into a single pdf.file.
    I have already bookmarks, shown on the screen (see screenshot below) but I want those bookmark to be visualised in a separate TOC in the top of the combined files.
    This new TOC (which I have inserted) shall be printable and serve as a cover page in a binder.
    I have seen other cheap pdf.programs in the market (e.g. PDF Converter Professional 7.3) which are able to make the above things, easy, fast and nice.
    Regards
    Ole Bünger, Kristianstad Sweden

    Somewhat roundabout way but this should work:
    Is there easy way to print bookmarks Acrobat Pro 9.5

  • How to upload a file into a db blob column from adf page

    How to upload a file into a db blob column from adf page
    Which option to use ?

    The forum search would be my first try...
    Then google...
    This has been asked at least once a week and got correct answers...
    Timo

Maybe you are looking for

  • Camera RAW 5.6RC update

    Is the Camera RAW 5.6 update suitable for PSE 7.0?

  • Oracle 11g, SRID & 3D-geometry

    Hi I migrated a spatial table from an Oracle 10 to an Oracle 11 database The table contains Multilines with M-values. I validate the Geometries with "SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT" In Oracle 10: No Errors. In Oracle 11g:  ORA-54668:  2D SRI

  • Finder only shows root folders, no folders or files within those

    2010 Mac mini. For some reason, Finder now only shows root folders such as Music, Library, Movies, Pictures, Downloads, Documents, etc. But when I open those folders, there is nothing contained INSIDE them. They appear empty. I know there ARE files a

  • Used Space - Other???

    Ok so I only have the 4gb (3.63) nano, and I have songs, videos and whatnot, but when I go to the memory used at least half or more is filled with the orange (other). What is this most likely..I would like to get rid of it so I have more memory.

  • When does itunes add a "play count"

    ive been using itunes for about a year now, and i am wondering how the play count feature works. i like to use the smart playlists for most played songs. when exactly does itunes add another play count to the column? i know with lastfm you can set it