This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

how to make the java application developed in windows environment work on FreeBSD?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks,
krishna.p
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
vkrishna krishna
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks,
krishna.p
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
vkrishna krishna
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks,
krishna.p
 
Sheriff
Posts: 22001
107
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
vkrishna krishna
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 70305
283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . 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.
 
    Bookmark Topic Watch Topic
  • New Topic