Hi Mark, 2009/12/15 MSB <[email protected]>: > I thought about this overnight because I did not want what I say next to > sound really patronising; anyway, here goes.
It's not a problem. I realise that there is always a possibility that I could be a recognised computer science professor with thirty years of working at the cutting edge under my belt, but you can rest assured, this is not the case! > 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. Not to worry. The other machine is a headless Debian box which will not be able to have Netbeans installed. Once I can be sure that the Java code is good, I'll copy it across to the production machine and compile it there. The reason I posted on here was that I couldn't be sure that my java code had access to the jar libraries it needed; once I can move it on the Production machine I shall be reasonably confident that it should run, given access to the relevant libraries. I will obviously make sure that these libraries are accessible to the code. > 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. That's great news; I shall definitely give that a go. > 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. Yes it doe. I shall certainly try to implement it when I get my app working. Thanks again, Dave Coventry --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
