I have inherited an application and have noted the below code in it… It appears to me that its picking up the local information from the local machine and then saving the information to fields. I’m curious what other kind of information can be gathered? Particularly - we have several applications that are picky about the given version of Java installed on the machine. I see that its picking up the OS and browswer versions … can I somehow get the Java version? What about the Notes data directory? Is there anything else I can aquire that could be useful? I appreciate your help.
Sub Postopen(Source As Notesuidocument)
If source.EditMode Then
Dim SI As New Sysinfo
Dim session As New NotesSession
Call Source.FieldSetText("NOTESUSER",session.UserName)
Call Source.FieldSetText("NOTESVERSION",session.NotesVersion)
Call Source.FieldSetText("Hostname", SI.GetLocalHostName)
Call Source.FieldSetText("IP", SI.GetIPAddress)
Call Source.FieldSetText("CPU", SI.GetCPUSpeed)
Call Source.FieldSetText("RES", SI.GetScreenResolution)
Call Source.FieldSetText("COLOR", SI.GetNumOfColors)
Call Source.FieldSetText("RAM", SI.GetTotalRAM)
Call Source.FieldSetText("WINVERSION", SI.GetWindowsVersion)
Call Source.FieldSetText("BROWSERVERSION", SI.GetIEVersionFriendlyName)
Call Source.FieldSetText("USERINFO", SI.GetCurrentUser)
Call Source.FieldSetText("NOTESPROGDIR", SI.GetNotesProgramDirectory)
Call Source.FieldSetText("AVAILABLEDRIVES", SI.GetDrives)
End If
End Sub
Subject: Environment Variables - Java
Well, there’s a lot that can be taken from the Runtime object (memory, etc.), and you can get the version from System.getProperty(“java.vm.version”).
Subject: RE: Environment Variables - Java
Any clue on where I could see a list of some of the items available? Where do I put this line of text, compared to my already existing text?
System.getProperty(“java.vm.version”)
ie: One of the lines is…
Call Source.FieldSetText(“Hostname”, SI.GetLocalHostName)
Thank you VERY much!
Subject: RE: Environment Variables - Java
Try Sun’s Java documentation. (Use Google to look for stuff with the “site:” parameter or use the advanced Google search. Sun’s built-in search isn’t quite up to snuff.) Source.FieldSetText? That’s not Java, and you can’t get Java runtime properties from LotusScript.
Subject: RE: Environment Variables - Java
[Quote]“you can’t get Java runtime properties from LotusScript”
[/Quote]
That pretty much answers my question. I was hoping to read a reg value that would tell me the current installed Java version (like the browser, or MS Word, or anything else). Knowing it can’t be done saves me a whole lot of time. Thanks so much for the quick reply Stan.
Subject: RE: Environment Variables - Java
It’s not that it can’t be done – but you can’t do it in LotusScript. Run a Java agent to query the Java runtime (this WAS a Java question, right?).
Subject: RE: Environment Variables - Java
LOL - Not necessarily. I just was hoping to find the currently installed version of Java on any Windows manchine via LotusScript. I have a specific key to find the version, I just need to find it.
But - As it turns out - I did search a bit more and found that this particular form had a bunch of Global variabled about as long as a football and I’ve decided that it must be way out of my league.
Subject: RE: Environment Variables - Java
That’s a bit more difficult anyway, since there may be any number of JVMs installed on a given machine. If the Java version you are looking for is for Notes, that’s fixed with the Notes version, but other than that you really have to go through the filesystem. I’ve got 1.1.8, 1.2, 1.3.1, and 1.4 on my machine, and I’ve looking at installing Java 5 (1.5). The best you can hope for otherwise is to look at the Registry to see what’s been set as the default for the desktop and the browser.
Subject: RE: Environment Variables - Java
This would be perfect for what we’re looking for. Is this still something complicated?