Error: LinkageError occurred while loading main class Test1
java.lang.UnsupportedClassVersionError: Test1 has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Project "LEDButton"
Authors: Fabio Hedayioglu, Ian Utting and Michael Kölling
飛ばします。
This project is part of the material for the tutorial for BlueJ on the Raspberry Pi.
このプロジェクトは、Raspberry Pi 上の BlueJ のチュートリアルの素材の一部です。
It is Part of the first and second tutorial: GPIO: LED and GPIO: Button.
最初と 2 番目のチュートリアルの一部です: GPIO: LED および GPIO: ボタン。
This is a simple object to demonstrate the use of an LED and a Button
connected to the Raspberry Pi using GPIOs.
LED とボタンの使用法を示す簡単なオブジェクトです。
GPIO を使用して Raspberry Pi に接続します。
You can manipulate LEDs and Buttons and interact with them either interactively
or programatically, by editing the class Controller.
LED とボタンを操作し、インタラクティブに操作できます。
または、クラス コントローラーを編集してプログラム的に。
This project is designed in such a way to make the manipulation of LEDs and Buttons
very easy and straightfoward, making it accessible even to the novice programmer.
All the implementation details are isolated to the user, in order to make the
teaching and use of the LED and Button classes completely free from low level details.
すべての実装の詳細は、ユーザーに分離されます。
LED およびボタンのクラスの教育と使用には、低レベルの詳細は一切含まれません。
The LED and Button classes are flexible and can be used in general purpose projects.
/**
* A controller for an LED at pin 6 and a Button at pin 7.
*
* Creates an LED (called led) and a Button (called button) for you to control.
*
* Class used for the BlueJ on Raspberry Pi turorial.
*
*/
public class Controller implements ButtonListener
{
private LED led;
private Button button;
/**
* Setup the Controller.
*/
public Controller()
{
led = new LED(6); // Create the LED at pin 6 controlled by this
button = new Button(7); // Create the Button at pin 7 controlled by this
button.addListener(this); // Make the button tell us when it has changed (See buttonChanged() below)
}
/**
* Turn the led on.
* (Exercise 1.2)
*
*/
public void turnLEDOn()
{
//put your code here.
}
/**
* Turn the led off.
* (Exercise 1.2)
*
*/
public void turnLEDOff()
{
//put your code here.
}
/**
* Keep the LED on for a given period of time, then turn it off.
* @param time the length of the flash in milliseconds (1/1000ths of a second).
* (Exercise 1.3)
*
*/
public void flash(int time)
{
//put your code here.
}
/**
* Blink the LED a number of times, each time the LED is kept on for a given period.
* (Exercise 1.4)
*
*/
public void flashSOS()
{
// Put your code here
}
/**
* To be called by the Button when it is pressed or released.
* (Exercises 2.1, 2.2 and 2.3)
*
*/
public void buttonChanged(boolean isPressed)
{
// Put your code here
}
/**
* Returns the amount of time in milliseconds between the LED turning on and the button being pressed.
* @return the reaction time in milliseconds.
* (Exercise 2.4)
*
*/
public int reactionTime()
{
// Replace the line below with your code
return 0;
}
/*
* You don't need to change the methods below this point.
* They are just to help you with the examples on the web page.
*/
/**
* Cause the program to sleep for a short time.
* @param milisec the number of milliseconds to sleep.
*
*/
public void sleepMillisec(int millisec)
{
try
{
Thread.sleep(millisec);
}
catch ( InterruptedException e)
{
}
}
private static long startTime = System.currentTimeMillis();
/**
* The current time, measured in milliseconds since the program started.
* @return integer with measured time in milliseconds.
*
*/
public int timeNow()
{
return ((int) (System.currentTimeMillis() - startTime));
}
}
実行
しかし、またエラーが。。。
6月 27, 2023 9:46:59 午前 com.pi4j.util.NativeLibraryLoader load
重大: Unable to load [libpi4j.so] using path: [/lib/raspberrypi/dynamic/libpi4j.so]
java.lang.UnsatisfiedLinkError: /tmp/libpi4j9090757756364282176.so: /tmp/libpi4j9090757756364282176.so: 間違った ELF クラスです: ELFCLASS32 (Possible cause: architecture word width mismatch)
public class HelloCV {
public static void main(String[] args){
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
Mat mat = Mat.eye(3, 3, CvType.CV_8UC1);
System.out.println("mat = " + mat.dump());
}
}