Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8131785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:11:03+00:00 2026-06-06T09:11:03+00:00

I have a virtual machine running Windows XP SP3 32-bit. On this machine I

  • 0

I have a virtual machine running Windows XP SP3 32-bit. On this machine
I installed the Java SE JDK 8 build b44 Developer Preview from here.

I also installed the JavaFX 2.1 SDK.

It works fine:

java -version
> java version "1.8.0-ea"
> Java(TM) SE Runtime Environment (build 1.8.0-ea-b44)
> Java HotSpot(TM) Client VM (build 24.0-b14, mixed mode, sharing)

I tried running the following program (taken from here):

import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.ButtonBase;
import javafx.scene.control.ToggleButton;
import javafx.scene.control.ToggleButtonBuilder;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;

public class LambdasWithJavaFx extends Application
{
    public static void main(String[] args)
    {
        Application.launch(args);
    }

    @Override  public void start(Stage stage) throws Exception
    {
        BorderPane root = new BorderPane();
        ToggleButton button = new ToggleButton("Click");
        final StringProperty btnText = button.textProperty();

        button.setOnAction(new EventHandler<ActionEvent>()
        {
            @Override public void handle(ActionEvent actionEvent)
            {
                ToggleButton source = (ToggleButton) actionEvent.getSource();
                if (source.isSelected())
                {
                    btnText.set("Clicked!");
                }
                else
                {
                    btnText.set("Click!");
                }
            }
        });

        root.setCenter(button);
        Scene scene = new Scene(root);
        stage.setScene(scene);
        stage.setWidth(200);
        stage.setHeight(200);
        stage.show();
    }
}

The program compiled and ran as expected.

I followed the instructions in that article and replaced the button event-handling code with this:

button.setOnAction((ActionEvent event)->
{
    ToggleButton source = (ToggleButton) event.getSource();
    if (source.isSelected())
    {
        btnText.set("Clicked!");
    }
    else
    {
        btnText.set("Click!");
    }
});

When compiling, I get the following error (on the line button.setOnAction((ActionEvent event)->):

> lambda expressions are not supported in -source 1.8
> (use -source 8 or higher to enable lambda expressions)

I added the argument -source 8, nothing changed.

All I wanted was to check the lambda expressions functionality in Java 8. Why doesn’t it work ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:11:04+00:00Added an answer on June 6, 2026 at 9:11 am

    You need to download the binaries which contain the Lambda expressions feature. Try downloading from here http://jdk8.java.net/lambda/.
    I remember reading in the mailing list that the lambda expression branch is being merged in the main JDK8 build, but not sure if its been done. But I use the build from the Lambda project page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running windows 7 and have installed an Ubuntu machine using virtual box.
I have a virtual machine running windows 2003 server running MOSS 2007. This virtual
I have a virtual machine running windows 2003 server. It is on a separate
I have a perl script running on a Debian virtual machine on VMWare. This
I am running Windows 7 on my machine. I have following web browsers installed:
I have a VMware virtual machine running Windows 2008 Standard and I would like
I have a Virtual Machine running the following: Windows Server 2008 SharePoint 2007 SP1
So I got a 64 bit virtual machine running x64 Windows Server 2003 Standard
I am running Windows 7 Professional 64-bit with visual Studio 2010. I have installed
I have a virtual machine running windows xp inside a vmware instance. How do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.