I am writing java code. which will work on windows and linux. some code are depend on platform base how can i check my application running on which platform ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well to get OS information you could have something like:
But your code MUST be platform independent. If you cannot achieve this by using java…well then probably you haven’t built your application the right way.
According to wikipedia: