Hi All, Iam new to java technology. I would like to configure the java application on a FreeBSD machine. Iam able to develop and run the project successfully using Eclipse on windows environment. Now i would like to move this application on to FreeBSD.
what are the steps that i need to follow to make the application run successfully on FreeBSD? Would appreciate if any of you can help me out. Thanks in advance.
In which way doesn't it work now? Assuming that a JRE of sufficient Java version is installed on FreeBSD, the application should just work. Create an executable jar file, and run that from the command line using "java -jar myJarFile.jar". Any error messages would then be shown in the console.
Thanks for the quick reply. currently iam copying my project on to a webapps/ directory of FreeBSD and then tried setting my project name in the server.xml file. would appreciate if you could please give me step by step procedure for deploying the windows java application on to a FreeBSD machine. My FreeBSD machine has java and tomcat configured successfully. please help me out. Thanks in advance.
Joined: Mar 22, 2005
What makes this a "Windows" java application? I don't think you need to touch server.xml at all. If this is a web app, try copying the whole directory (the one inside "webapps") from your Windows machine to the FreeBSD machine.
Joined: Feb 11, 2009
Thanks for the reply Ulf Dittmer. you are correct. my problem is resolved. i have just copied my project from windows environment and placed it into webapps/ directory of FreeBSD. This time i didnot change any thing like server.xml. Now the project is working absolutely fine. Thanks for all the help.
Generally, applications should work under any operating system. If this is not the case, it is a case of the programmer having used platform specific pieces of code:
- absolute file paths based on the file system (e.g. using C:\WINDOWS)
- calling external programs using Runtime.exec and/or ProcessBuilder - using native libraries available only for a select few operating systems
Besides those, some things may not work as expected for similar reasons:
- using \ in file paths. Using / will work under all operating systems, but \ usually only works with Windows. The ideal solution uses File.separator or File.separatorChar.
- using platform specific line separators like \n. The ideal solution uses either System.getProperty("line.separator") or the formatting introduced in Java 5.0 with %n.
- using ; or : to separate paths. File.pathSeparator or File.pathSeparatorChar should be used instead.
I think those will account for at least 90-95% of all platform incompatibilities.
Thanks for suggestions Rob Prime. Are there any other areas apart from the ones mentioned below that i need to concentrate? Because I am developing my project in windows environment and will be placing the same on to the FreeBSD box. so i want to make sure that operating systems dependent issues dont crop up. Would appreciate if you can please tell me the key areas that i need to concentrate like line seperators, file paths etc. would appreciate if you can give me any link or info on this OS dependent areas.Thanks in advance.
. . . and you can probably get your 90-05% up to 91-96% if you remember that Windows uses ctrl-Z as end-of-file and other operating systems use something including ctrl-D. I can't remember the exact values.