I can't run JavaFX application. I just want to store some data into table and see it.But only I got mistake someone please help me.
this is my controller class
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import java.net.URL;
import java.util.ResourceBundle;
public class Controller implements Initializable {
#FXML
TableView<Person> table;
#FXML
TableColumn<Person,Integer> number;
#FXML
TableColumn<Person,String> name;
#FXML
TableColumn<Person,String> surname;
#Override
public void initialize(URL location, ResourceBundle resources) {
table = new TableView<>();
number = new TableColumn<>();
name = new TableColumn<>();
surname = new TableColumn<>();
number.setCellValueFactory(new PropertyValueFactory<Person, Integer>("id"));
name.setCellValueFactory(new PropertyValueFactory<Person, String>("name"));
surname.setCellValueFactory(new PropertyValueFactory<Person, String>("surname"));
ObservableList<Person> data = FXCollections.observableArrayList(new Person(1,"fa","fafe"));
table.setItems(data);
table.getColumns().addAll(number,name,surname);
}
}
but I'm getting following errors which I get from terminal I gave every id to my components
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:875)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$147(LauncherImpl.java:157)
at com.sun.javafx.application.LauncherImpl$$Lambda$1/1927950199.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: javafx.fxml.LoadException: Error resolving onEditStart='#click', either the event handler is not in the Namespace or there is an error in the script.
/D:/work%20proyeqt%20immidetely/WorkWithTable/out/production/WorkWithTable/sample/sample.fxml:15
at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2591)
at javafx.fxml.FXMLLoader.access$100(FXMLLoader.java:104)
at javafx.fxml.FXMLLoader$Element.processEventHandlerAttributes(FXMLLoader.java:606)
at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:766)
at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2817)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2526)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2435)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3208)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3169)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3142)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3118)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3098)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3091)
at sample.Main.start(Main.java:13)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$153(LauncherImpl.java:821)
at com.sun.javafx.application.LauncherImpl$$Lambda$50/355529278.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$166(PlatformImpl.java:323)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/2000304245.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292)
at com.sun.javafx.application.PlatformImpl$$Lambda$48/225942701.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291)
at com.sun.javafx.application.PlatformImpl$$Lambda$47/2051067688.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
at com.sun.glass.ui.win.WinApplication$$Lambda$38/517043427.run(Unknown Source)
... 1 more
this is error just keeping occur in my terminal.what it might be wrong please help me to solve this. I just want to store some data into my table that's it and see the result in application.
welcome to Stack Overflow!
The important line in your error message is this one:
Caused by: javafx.fxml.LoadException: Error resolving onEditStart='#click', either the event handler is not in the Namespace or there is an error in the script.
/D:/work%20proyeqt%20immidetely/WorkWithTable/out/production/WorkWithTable/sample/sample.fxml:15
This means that there is an error on line 15 of sample.fxml, specifically where it says onEditStart='#click'. Either it can't resolve 'onEditStart' or click() isn't a function in the controller.
Related
I have some trouble with launching a javafx application. To explain, I wrote a code that worked but I was on Ubuntu 19.04 and I decided to reinstall my Linux version (20.04). I copied my code and reinstalled e(fx)clipse, scenebuilder, openjfx, and imported the same jfxrt.jar but nothing worked. I can't manage to launch javafx application, even if the code is empty (ig code). Oh and I have to use java 8 for this homework.
Can you help me please?
Here is my code
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.FlowPane;
import javafx.stage.Stage;
public class LaunchApplication extends Application {
public static void main(String[] args) {
launch(args);
}
//Empty but still error
#Override
public void start(Stage arg0) throws Exception {
}
//Old code, doesnt work anymore
// #Override
// public void start(Stage primaryStage) throws Exception {
// try {
//
// FXMLLoader loader = new FXMLLoader();
// loader.setLocation(getClass().getResource("view/Login.fxml"));
// Parent root = loader.load();
//
// Scene scene = new Scene(root);
// primaryStage.setScene(scene);
// primaryStage.setResizable(true);
// primaryStage.show();
//
// } catch (Exception e) {
// System.out.println(e);
// }
//
// }
}
And there my error when running it
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodError: <init>
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:288)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:211)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:337)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
... 5 more
Caused by: java.lang.NoSuchMethodError: <init>
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1817)
at java.lang.Runtime.load0(Runtime.java:810)
at java.lang.System.load(System.java:1088)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:107)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:39)
at com.sun.glass.ui.gtk.GtkApplication.lambda$new$5(GtkApplication.java:156)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:140)
at com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
at com.sun.glass.ui.Application.run(Application.java:146)
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:278)
... 9 more
```
Hello everyone im trying to make a simple video player with javafx and then add some controls later with scene builder however I cant even get the simple video to play , I keep getting an error saying
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.IllegalAccessError: class com.sun.media.jfxmediaimpl.NativeMediaManager (in unnamed module #0x22fda225) cannot access class com.sun.glass.utils.NativeLibLoader (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.utils to unnamed module #0x22fda225
at com.sun.media.jfxmediaimpl.NativeMediaManager.lambda$new$0(NativeMediaManager.java:110)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
at com.sun.media.jfxmediaimpl.NativeMediaManager.<init>(NativeMediaManager.java:107)
at com.sun.media.jfxmediaimpl.NativeMediaManager$NativeMediaManagerInitializer.<clinit>(NativeMediaManager.java:78)
at com.sun.media.jfxmediaimpl.NativeMediaManager.getDefaultInstance(NativeMediaManager.java:90)
at com.sun.media.jfxmedia.MediaManager.canPlayProtocol(MediaManager.java:78)
at com.sun.media.jfxmedia.locator.Locator.<init>(Locator.java:239)
at javafx.scene.media.Media.<init>(Media.java:393)
at javaapplication3.JavaApplication3.start(JavaApplication3.java:45)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
... 1 more
Exception running application javaapplication3.JavaApplication3
C:\Users\adamk\OneDrive\Documents\NetBeansProjects\JavaApplication3\nbproject\build-impl.xml:1341: The following error occurred while executing this line:
C:\Users\adamk\OneDrive\Documents\NetBeansProjects\JavaApplication3\nbproject\build-impl.xml:936: Java returned: 1
BUILD FAILED (total time: 1 second)
I made sure that the path is correct and everything but it still wont play. can someone please help ? thanks !!!
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication3;
/**
*
* #author adamk
*/
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.beans.property.DoubleProperty;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.Group;
import javafx.scene.media.MediaView;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import java.io.File;
public class JavaApplication3 extends Application
{
public static void main(String[] args) {
launch(args);
}
#Override
public void start(Stage primaryStage) throws Exception {
String path = "C:\\1.mp4";
//Instantiating Media class
Media media = new Media(new File(path).toURI().toString());
//Instantiating MediaPlayer class
MediaPlayer mediaPlayer = new MediaPlayer(media);
//Instantiating MediaView class
MediaView mediaView = new MediaView(mediaPlayer);
//by setting this property to true, the Video will be played
mediaPlayer.setAutoPlay(true);
//setting group and scene
Group root = new Group();
root.getChildren().add(mediaView);
Scene scene = new Scene(root,500,400);
primaryStage.setScene(scene);
primaryStage.setTitle("Playing video");
primaryStage.show();
}
}
I recently started learning JavaFX and my class was given the following assignment:
Write a program that displays four images in a grid pane.
Here is my code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
public class Ch_14_Ex_1 extends Application {
#Override //Override the start method in the Application class
public void start(Stage primaryStage) {
//Create a pane to hold the image views
GridPane pane = new GridPane();
//Place nodes in the pane
pane.add(new ImageView(new Image("image/ukFlag1.gif")), 0, 0);
pane.add(new ImageView(new Image("image/canadaFlag1.gif")), 1, 0);
pane.add(new ImageView(new Image("image/chineseFlag1.gif")), 0, 1);
pane.add(new ImageView(new Image("image/usaFlag1.gif")), 1, 1);
//Create a scene and place it in the stage
Scene scene = new Scene(pane);
primaryStage.setTitle("Ch_14_Ex_1"); //Set the stage title
primaryStage.setScene(scene); //Place the scene in the stage
primaryStage.show(); //Display the stage
}
}
The program compiles fine but whenever I try to run the program I get the following error and i'm not sure how to fix it.
Exception in Application start method
Exception in thread "JavaFX BlueJ Helper" java.lang.RuntimeException:
Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Invalid URL: Invalid URL or resource not found
at javafx.scene.image.Image.validateUrl(Image.java:1118)
at javafx.scene.image.Image.<init>(Image.java:620)
at Ch_14_Ex_1.start(Ch_14_Ex_1.java:16)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
... 1 more
Caused by: java.lang.IllegalArgumentException: Invalid URL or resource not found
at javafx.scene.image.Image.validateUrl(Image.java:1110)
... 11 more
You can set the resources folder in your project in case you wanna wrap it in your jar file and load them like so
new Image(getClass.getResourceAsStream("image/yourImage.gif"))
OR
If those images are not in your resources you can load them like so
new Image("file:image/yourimage.gif")
I'm trying to create a TabHost in ListView in a TabHost, and I get the cast error.
enter code here Process: com.example.vaidenv2, PID: 30623
java.lang.ClassCastException: com.example.vaidenv2.FQAGeneralFragment cannot be cast to android.support.v4.app.Fragment
at android.support.v4.app.Fragment.instantiate(Fragment.java:420)
at android.support.v4.app.FragmentTabHost.doTabChanged(FragmentTabHost.java:343)
at android.support.v4.app.FragmentTabHost.onAttachedToWindow(FragmentTabHost.java:280)
at android.view.View.dispatchAttachedToWindow(View.java:13406)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2707)
at android.view.ViewGroup.addViewInner(ViewGroup.java:3919)
at android.view.ViewGroup.addView(ViewGroup.java:3733)
at android.view.ViewGroup.addView(ViewGroup.java:3678)
at android.view.ViewGroup.addView(ViewGroup.java:3654)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:968)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1136)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:739)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1499)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:456)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Here is my code in Fragment,
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTabHost;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class FAQFragment extends Fragment{
FragmentTabHost mTabHost = null;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mTabHost = new FragmentTabHost(getActivity());
mTabHost.setup(getActivity(), getChildFragmentManager(),
android.R.id.tabcontent);
mTabHost.addTab(mTabHost.newTabSpec("sub1").setIndicator("General"),
FQAGeneralFragment.class, null);
mTabHost.addTab(mTabHost.newTabSpec("sub2").setIndicator("Endor"),
FQAEndorFragment.class, null);
return mTabHost;
}
}
Could someone help me to see how to solve this. And the library and package are all most recent version.
The Logcat error is pointing to FQAGeneralFragment as the error.
I do not know FQAGeneralFragment type. I suspect it is not android.support.v4.app.Fragment class type. I would think FQAGeneralFragment is defined in another Java file, and you need to import android.support.v4.app.Fragment.
Please check it out and have fun...
I'm developing an OSGI (Equinox) Based-System and i came across JavaFX, i was trying the e(fx)clipse {OSGI bundle project} and i wrote a simple test project, but it is giving me some compilation errors.
i have a main class :
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class main extends Application {
private static main _main ;
public main () {
_main = this;
}
public static main Get_Main(){
return _main;
}
#Override
public void start(Stage primaryStage)
{
try
{
FXMLLoader loader = new FXMLLoader();
loader.setLocation(main.class.getResource("fxml.fxml"));
primaryStage.setScene(new Scene(loader.load()));
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
and i have a controller for the FXML
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
public class controller {
#FXML
private AnchorPane _AnchorPane;
#FXML
private Button _Btn;
#FXML
private void initialize() {
_AnchorPane.setOnMouseClicked(new EventHandler<MouseEvent>() {
#Override
public void handle(MouseEvent event) {
_AnchorPane.setStyle("-fx-background-color:red");
}
});
}
#FXML
private void _BtnClick() {
_AnchorPane.setStyle("-fx-background-color:blue");
}
}
and an Activator for the bundle
import javafx.stage.Stage;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class aCTIVATOR implements BundleActivator {
private Stage _stage = new Stage();
private main _main;
#Override
public void start(BundleContext context) throws Exception {
_main = main.Get_Main();
_main.start(_stage);
}
#Override
public void stop(BundleContext context) throws Exception {
_stage.close();
}
}
and this is my manifest file :
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name:
Bundle-SymbolicName: root
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: javafx.animation;version="2.0.0",
javafx.application;version="2.0.0",
javafx.beans;version="2.0.0",
javafx.beans.binding;version="2.0.0",
javafx.beans.property;version="2.0.0",
javafx.beans.value;version="2.0.0",
javafx.collections;version="2.0.0",
javafx.concurrent;version="2.0.0",
javafx.event;version="2.0.0",
javafx.fxml;version="2.0.0",
javafx.geometry;version="2.0.0",
javafx.scene;version="2.0.0",
javafx.scene.chart;version="2.0.0",
javafx.scene.control;version="2.0.0",
javafx.scene.control.cell;version="2.0.0",
javafx.scene.effect;version="2.0.0",
javafx.scene.image;version="2.0.0",
javafx.scene.input;version="2.0.0",
javafx.scene.layout;version="2.0.0",
javafx.scene.media;version="2.0.0",
javafx.scene.paint;version="2.0.0",
javafx.scene.shape;version="2.0.0",
javafx.scene.text;version="2.0.0",
javafx.scene.transform;version="2.0.0",
javafx.scene.web;version="2.0.0",
javafx.stage;version="2.0.0",
javafx.util;version="2.0.0"
Bundle-Activator: aCTIVATOR
Require-Bundle: org.eclipse.osgi;bundle-version="3.10.0"
so when i go to the Run-Configuration, i choose OSGI-FrameWork and select the
project
org.eclipse.osgi
org.eclipse.fx.javafx
org.eclipse.fx.osgi
and finally it si giving my this compilation error:
!SESSION 2014-10-21 13:32:14.128 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_20
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -dev file:/home/hany/workspace/JavaFX/.metadata/.plugins/org.eclipse.pde.core/New_configuration/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog -console
!ENTRY root 4 0 2014-10-21 13:32:14.618
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Error starting module.
at org.eclipse.osgi.container.Module.doStart(Module.java:567)
at org.eclipse.osgi.container.Module.start(Module.java:429)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1551)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1531)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1502)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1445)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.NoClassDefFoundError: javafx/stage/Stage
at aCTIVATOR.<init>(aCTIVATOR.java:8)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at java.lang.Class.newInstance(Class.java:433)
at org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:755)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:706)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:928)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:317)
at org.eclipse.osgi.container.Module.doStart(Module.java:558)
... 8 more
Caused by: java.lang.ClassNotFoundException: javafx.stage.Stage cannot be found by osgi.identity; osgi.identity="root"; type="osgi.bundle"; version:Version="1.0.0.qualifier"
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:365)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:331)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:323)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 19 more
Root exception:
java.lang.NoClassDefFoundError: javafx/stage/Stage
at aCTIVATOR.<init>(aCTIVATOR.java:8)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at java.lang.Class.newInstance(Class.java:433)
at org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:755)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:706)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:928)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:317)
at org.eclipse.osgi.container.Module.doStart(Module.java:558)
at org.eclipse.osgi.container.Module.start(Module.java:429)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1551)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1531)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1502)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1445)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.ClassNotFoundException: javafx.stage.Stage cannot be found by osgi.identity; osgi.identity="root"; type="osgi.bundle"; version:Version="1.0.0.qualifier"
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:365)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:331)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:323)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 19 more
!ENTRY org.eclipse.osgi 4 0 2014-10-21 13:32:14.621
!MESSAGE Bundle root_1.0.0.qualifier [4] is not active.
!ENTRY org.eclipse.osgi 4 0 2014-10-21 13:32:14.622
!MESSAGE Could not find bundle: org.eclipse.equinox.console
!STACK 0
org.osgi.framework.BundleException: Could not find bundle: org.eclipse.equinox.console
at org.eclipse.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:58)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:323)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:222)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
!!!!!!!(this was a long one)
So any idea or help about this?
The reason you see the "java.lang.NoClassDefFoundError" is that Equinox does not consult the Ext-classpath and most likely you don't tell Equinox to use our adaptor hooks who make equinox consult that path.
What you need to do is to:
Ensure that you have org.eclipse.fx.osgi fragment in your launch
Make sure you pass -Dosgi.framework.extensions=org.eclipse.fx.osgi as VM arguments in your launch config
(Update) Preferred option launch with -Dorg.osgi.framework.bundle.parent=ext
Now that I've answered your real question. I can not end with a final note on your style of asking and replying to people. This is not good and I've thought multiple times about whether I should answer. Stop putting exclamation marks in your questions and reply and before putting someone down think twice if this the correct way to talk to someone who tried to help you!