Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / February 2006

Tip: Looking for answers? Try searching our database.

Changing the System.getProperty("os.name") value

Thread view: 
ktdreyer@gmail.com - 19 Jan 2006 23:01 GMT
Hi,

I have a question about running a particular applet within my browser.

If this applet calls System.getProperty("os.name"), the JVM will return
the proper OS. Is there any way to change what value this function
returns? I'd like to return a value that imitates Linux or Mac OS. I'm
using Windows, so is there a registry key or configuration file I can
change?

Thanks
- Ken
IchBin - 19 Jan 2006 23:30 GMT
> Hi,
>
[quoted text clipped - 8 lines]
> Thanks
> - Ken

Yes you can..

System.setProperty("os.name", "Windows XP") ;

Signature

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)

ktdreyer@gmail.com - 21 Jan 2006 21:57 GMT
Thank you, but this is not my applet and I do not have access to the
source code. Is there another way to accomplish this?

- Ken
Roedy Green - 21 Jan 2006 23:01 GMT
>Thank you, but this is not my applet and I do not have access to the
>source code. Is there another way to accomplish this?

You can decompile it, fiddle it, and recompile it. It may take some
adjusting.  You might need to hire someone to do the patch.

http://mindprod.com/decompiler.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Simon - 03 Feb 2006 15:23 GMT
ktdreyer@gmail.com schrieb:
> Thank you, but this is not my applet and I do not have access to the
> source code. Is there another way to accomplish this?
>
> - Ken

You can extend the applet's main class, override init() to make the call to
System.setProperty(), and possibly add the new class to the applet's jar.
Roedy Green - 03 Feb 2006 15:48 GMT
>> Thank you, but this is not my applet and I do not have access to the
>> source code. Is there another way to accomplish this?

You can always disassemble or decompile them. The code is remarkably
like the original.
See http://mindprod.com/jgloss/decompiler.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Roedy Green - 06 Feb 2006 00:20 GMT
>You can extend the applet's main class, override init() to make the call to
>System.setProperty(), and possibly add the new class to the applet's jar.
And I hope it goes without saying , calls super.init().
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Thomas Hawtin - 04 Feb 2006 09:53 GMT
> Thank you, but this is not my applet and I do not have access to the
> source code. Is there another way to accomplish this?

If you run it in the appletviewer, then you can use:

     -J-Dos.name="Mac OS"

Note, all the other properties will remain the same, as will various
implementations. It wont start looking like Aqua.

Tom Hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.