|
Pls help and provide the way .....
|
|
|
|
|
How to check with Java that a program is installed on Linux or Mac.
In windows I can check registry for a specific entry or to check the existence of program folder.
Thanks.
|
|
|
|
|
This is not really a Java issue, more one of how to get information from the OS. You would probably need to research program installation on each of these platforms. See also the Java Desktop[^] class.
|
|
|
|
|
Pretty sure there is an environmnet variable that specifies the windows version.
That won't exist on OSX
Probably something similar on OSX.
Although there might even be a VM specific value that has such information.
You can use System.getProperties() to list all the env vars for the VM.
|
|
|
|
|
There are three system properties which give you the information:
os.name
os.version
os.arch
The problem is that there is no standard defined list: different JVM implementations can return different values for these properties as long as they are consistent for the same JVM on the same operating system. Not only that, prior to Java 1.6 u14, the Sun hotspot JVM reported Windows 7 as being Windows Vista version 6.1 and then subsequent releases changed to Windows 7 version 6.1, so anyone who relied on this and upgraded from u14 to a later release suddenly found their code was behaving differently after a so-called "minor" upgrade.
So I would treat these system properties with a certain amount of caution. It might be good enough, though, if all you need to know is "it's not Windows".
|
|
|
|
|
At least for the code I create all of those situations would have required that the apps be certified for the target platform anyways.
But one solution presents itself if it is an issue. Use a configurable source which allows one to map os/vm values to application values.
|
|
|
|
|
Also the reason why I prefer to bundle a Java runtime with the app rather than relying on whatever random version of Java happens to be installed on the customer's machine. That makes it more predictable and easier to control.
I think (can't guarantee this, but I believe it to be true) that the os.name for Windows on the hotspot JVM can be relied on to start with "Windows" (although some versions may report Windows XP as being Windows 2000, and some report Windows 7 as being Windows Vista). Last time I used the JRockit JVM (about 3 years ago) that was the same. And as far as I am aware, different flavours of Linux all start with "Linux". So if that's all you need to know, that should probably be OK. I can't think of a reason why you would want to know that you are running on Ubuntu release 10.04 with Linux kernel 2.6.32 but who knows, I'm sure somebody somewhere has had that requirement in the past.
|
|
|
|
|
I want ajax popup controll using login screen,
please help me...
|
|
|
|
|
|
hi there i am trying write a function that checks if a string contains punctuation characters like %,&,!. because i dont want to user enter an invalid name last_name so i want check the string.
|
|
|
|
|
A quick Google search finds this page[^].
Unrequited desire is character building.
|
|
|
|
|
well yes i know this class but i guess there arent any specific functions which they check specific characters. as you see in the link http://cplusplus.com/reference/clibrary/cctype/ there are several functions. but in java i can't check a string contains only alphabetic characters_?
|
|
|
|
|
You can do this using regular expressions. A google search for "java regular expression" will give you some good links.
|
|
|
|
|
thanks mate i will try it then : )
|
|
|
|
|
The Java functions mirror the same functions in C and cover most of what you need.
Unrequited desire is character building.
|
|
|
|
|
quartaela wrote: because i dont want to user enter an invalid name last_name
How exactly did you determine that such characters would be invalid in the name?
Or more specifically is this a business requirement?
And what exactly do you think the business process will be if someones legal names does have one of the characters that you excluded?
|
|
|
|
|
hey sorry for late answer : ). nope this is not a business requirement only a little work. so i mean you can not use "!+^%.." characters in name. for exmaple "Pe&%ter".
|
|
|
|
|
i think we don't have ispunct,isspace methods in java,if you observe JAVA API you may get clarity.If you know exactly please keep sample code in site along related documentation.
|
|
|
|
|
Hello,
How to pass data (like string) from applet to web page client code? that is to value parameter of a label (or asp label).
Is it possible to change the value of <param .../> (member of <applet> tag) from applet?
Is it possible to do it without javascript?
Thanks.
|
|
|
|
|
Hi,
http://www.cafeaulait.org/course/week5/16.html
http://web-design.lovetoknow.com/Javascript_Applet_Communication
http://bytes.com/topic/javascript/answers/89259-novice-question-regarding-passing-parameters-javascript-applet
|
|
|
|
|
No! I need to pass data from applet to a webpage (to html control) and not from page to applet. Or I need to make any change in webpage from applet that can be detected with a script.
So what I need is to make the webpage know when the applet finishes its function operations/work.
|
|
|
|
|
If the applet is signed I believe you can execute a javascript function from within the applet using the showDocument and provide it a link like:
showDocument(new URL("javascript:myCallback()");
|
|
|
|
|
Hi,
http://download.oracle.com/javase/tutorial/deployment/applet/invokingAppletMethodsFromJavaScript.html
|
|
|
|
|
#
# An unexpected error has been detected by Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d9ac0c6, pid=1972, tid=932
#
# Java VM: Java HotSpot(TM) Client VM (10.0-b23 mixed mode, sharing windows-x86)
# Problematic frame:
# V [jvm.dll+0x13c0c6]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x02aac800): VMThread [stack: 0x02b90000,0x02be0000] [id=932]
......................and it goes on to give a lot of other data.
How do I interpret it?
|
|
|
|
|
kartikdasani wrote: # If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
That seems a fairly clear piece of advice. Unless you have the source code of the JVM I would suspect there is not much in the dump that will make a lot of sense.
The best things in life are not things.
|
|
|
|