通过SlackBuild脚本在Slackware上安装openjfx时,未指定$ JAVA_HOME路径

时间:2018-10-02 16:31:30

标签: java slackware openjfx

根据$ java -version:

openjdk version "1.8.0_91"
OpenJDK Runtime Environment (IcedTea 3.0.1) (Slackware)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)

执行SlackBuild脚本说:

"No valid JRE installation found in [$JAVA_HOME] to match ARCH $ARCH or $[JAVA_HOME] not set properly."

实际上,由于某种原因,脚本本身内部没有$ JAVA_HOME的声明(?)。如何解决?

1 个答案:

答案 0 :(得分:2)

{open,} jre / jdk安装完成后,您需要重新登录,以便在/etc/profile.d/中安装新的* .sh和* .csh文件以建立正确的环境。

使用root登录外壳程序(su-)运行SlackBuild。

SlackBuild的名称是什么? openjfx.SlackBuild检查JAVA_HOME env var:

    AlertDialog.Builder builder = new AlertDialog.Builder(this);

    inflatedView = getLayoutInflater().inflate(R.layout.design_style,null);

     //No need of setView() for buttons
    builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            Toast.makeText(MainActivity.this,"OK Pressed",Toast.LENGTH_SHORT).show();
        }
    }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            Toast.makeText(MainActivity.this,"Cancel",Toast.LENGTH_SHORT).show();
        }
    });

    fontList = inflatedView.findViewById(R.id.fontlist);
    sizeList = inflatedView.findViewById(R.id.sizelist);

    fontList.setLayoutManager(new LinearLayoutManager(this));
    fontList.setAdapter(new MyAdapter(Arrays.asList(fonts)));

    sizeList.setLayoutManager(new LinearLayoutManager(this));
    sizeList.setAdapter(new MyAdapter(Arrays.asList(sizes)));

    builder.setView(inflatedView); //Set the view at the end

    AlertDialog dialog = builder.create();
    dialog.show();

openjfx需要具有profile.d / openjdk8。{sh,csh}脚本的openjdk8,以便在用户登录时(通过/ etc / profile运行)设置JAVA_HOME环境变量。在64位系统上,openjdk8.SlackBuild修补/ lib64 /而不是/ lib /的脚本。