Hello Dave,

I thought about this overnight because I did not want what I say next to
sound really patronising; anyway, here goes.

When you deploy the application you are working on, you will not deploy the
.java file as it contains the source code you have created. Rather, you will
deploy the .class file which contains the pre-compiled bytecode that the JVM
will load, compile into native code and then run. Also, you will need to
make sure that the machine upon which your application runs has access to
the POI archives because the JVM needs to locate, load and run one or more
of the classes it contains. I am sure you knew all of this and that is why I
worried about it sounding patronising, but when you said in you last message
that you interest was in a single .java file that you planned to implement
on another machine, I worried a bit.

Now, one of the easiest ways to achieve all of this is to use the contents
of the dist sub-folder that Netbeans will create for you. It will create an
archive that contains your class and ensure that the other archives your
application needs are copied into it's lib sub-folder. All you then need to
do is copy this over to the host machone and your application ought to run.
Of course, you do not have to use this structure and there are good reasons
not to do so; you can copy the POI archive into a different folder even on
another machine as long as you ensure that it is accessible to your
application at runtime. It is quite likely that you will need to set the
-classpath environment variable to ensure that the JVM can locate the
resources it requires at runtime. I work almost exclusivly on Windows and
use .bat files (batch files) extensively to run applications as they allow
me to create instructions such as this;

"C:\Program Files\Java\jre1.6.0_07\bin\java" -classpath ".;..;" -jar
"C:\Work Area\Programming\Java\Development\Netbeans\Neat\File
Processor\dist\File_Processor.jar"

and set the -classpath the application uses when it is executed. Sadly, I do
not know if such a mechanism exists on Linux but suspect that it does.

Yours

Mark B


Dave Coventry-4 wrote:
> 
> Hi Mark,
> 
> I've set up as a project, but my interest is in the single *.java file
> that I'm planning to implement on the production machine.
> 
> Basically I want the Netbeans IDE to do my debugging as I go along
> (which, as I last dabbled in Java some eight or nine years ago, I'm
> finding very useful).
> 
> Thanks very much for the tips.
> 
> - Dave
> 
> 2009/12/14 MSB <[email protected]>:
>>
>> Morning Dave,
>>
>> Must admit that I use Netbeans all of the time and I just want to ask a
>> couple of questions to bve clear about what you are asking.
>>
>> Firstly, can I assume that you now have the IDE set up so that you can
>> build
>> and test your project within Netbeans?
>> Secondly, have you created a project for your application?
>>
>> If the answer to both of these questions is 'yes' and all that you are
>> concerned about now is deploying the application, then take a look in the
>> dist sub-folder of your project folder. There, you will find a file
>> called
>> readme.txt that explains what you need to do to distribute the
>> application.
>> I have pasted into this message the contents of the readme file from a
>> very
>> simple test application;
>>
>> ========================
>> BUILD OUTPUT DESCRIPTION
>> ========================
>>
>> When you build an Java application project that has a main class, the IDE
>> automatically copies all of the JAR
>> files on the projects classpath to your projects dist/lib folder. The IDE
>> also adds each of the JAR files to the Class-Path element in the
>> application
>> JAR files manifest file (MANIFEST.MF).
>>
>> To run the project from the command line, go to the dist folder and
>> type the following:
>>
>> java -jar "rowstyle.jar"
>>
>> To distribute this project, zip up the dist folder (including the lib
>> folder)
>> and distribute the ZIP file.
>>
>> Notes:
>>
>> * If two JAR files on the project classpath have the same name, only the
>> first
>> JAR file is copied to the lib folder.
>> * Only JAR files are copied to the lib folder.
>> If the classpath contains other types of files or folders, none of the
>> classpath elements are copied to the lib folder. In such a case,
>> you need to copy the classpath elements to the lib folder manually after
>> the
>> build.
>> * If a library on the projects classpath also has a Class-Path element
>> specified in the manifest,the content of the Class-Path element has to be
>> on
>> the projects runtime path.
>> * To set a main class in a standard Java project, right-click the project
>> node
>> in the Projects window and choose Properties. Then click Run and enter
>> the
>> class name in the Main Class field. Alternatively, you can manually type
>> the
>> class name in the manifest Main-Class element.
>>
>> As Hannes indicated, I think that your problems are centered around the
>> -classpath; it 'tells' the runtime environment where to search for, find
>> and
>> load the necessary resources at runtime (bet you knew that already,
>> sorry).
>>
>> Yours
>>
>> Mark B
>>
>>
>>
>> Dave Coventry-4 wrote:
>>>
>>> Hannes,
>>>
>>> Thanks for taking the time to help.
>>>
>>> I'd already seen the link but I added the jar files to the Run tab. It
>>> was only when I added it to the Compile tab that it worked.
>>>
>>> I have a feeling I'm going to find it difficult to imp[lement on my
>>> Debian Production system.
>>>
>>> Thanks again,
>>>
>>> Dave
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Installing-the-POI-jars-for-Netbeans-tp26765779p26773995.html
>> Sent from the POI - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Installing-the-POI-jars-for-Netbeans-tp26765779p26790941.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to