Determining if code is on cRIO

Hello, I was wondering if there is a good way to determine whether or not the code is running on the cRIO. Since I do not have the cRIO with me, I wrote an if statement that I am guessing would work.

It will return true if it is on the cRIO, false if on a PC/Mac.


//Lines 2-8 on LimitSwitches/NICompactRIOToolkit.java
public boolean iscRIO(){
		if(System.getProperty("os.arch").contains("amd64") || System.getProperty("os.arch").contains("x86_64") || System.getProperty("os.arch").contains("x86") || System.getProperty("os.arch").contains("i386")){
			return false;
		}else{
			return true;
		}
	}

EDIT: Code is on GitHub, this specific class is here
https://github.com/itguy51/RobotClasses/blob/master/LimitSwitches/NICompactRIOToolkit.java

Side note: If anyone knows where to get the WPILibJ libraries as a binary, .jar or otherwise], that would be very helpful

On my computer it’s in C:\Users<UserName>\sunspotfrcsdk\lib\WPILibJ\suite

I don’t see why this would be helpful. Code I’d write to run on the cRio and code I’d write to run on a PC would be different in big enough ways that I don’t think I’d ever need to check whether the code is on the cRio from the program itself. Not only are the Java versions different when comparing the cRio to the PC (Java ME vs Java SE), most of the libraries that work on one would not work on the other (SmartDashboard and javacv would never be able to run on the cRio, and WPILibJ uses too much direct hardware access to be usable on a PC). I think a better choice than having a runtime check for whether or not the program is running on the cRio would be to simply write the program for the platform it’s being deployed on.

This code is not to be a full-out Robot program, it is a set of tools, sort of an extension, consisting of ‘drivers’ for Limit Switches and other third-party, non-KOP parts. I am writing it so that it runs on a PC and a cRIO for the sake that it’s also going to be used in teaching how to write for the bot. I could build an x86 version, and a cRIO version, but if I can avoid that at all, it would be great.

Thank you VERY much, I knew they would be local, but I had no idea where to look.