I try to get started with Eclipse 4-10 and SWT, but importing the SWT Library
in the java project doesn't work.
Here is what I did:
Download Win 64bit Version of Eclipse 2018-12 and SWT library from here:
https://download.eclipse.org/eclipse/downloads/drops4/R-4.10-201812060815/
use the Eclipse internal Installer to download and install "SWT Designer" with all it's dependencies from 2018-12 - http://download.eclipse.org/releases/2018-12
import the SWT-library-zip-file to the workspace via "File"->"Import"->"Existing projects into workspace"...
create a new java project, called testproject
get to testprojects "Properities"->"Java Build Path"->Tab "Projects"->Select "Classpath"->"Add"->select the org.eclipse.swt
Create an Application Window in my testproject via "create new visual classes"->"SWT"->"Application Window", called testwindow
But the import statements in the testwindow.java still show "the import org.eclipse cannot be resolved".
The setup process is according to the official eclipse site: https://www.eclipse.org/swt/eclipse.php
I use Windows 10 64bit, eclipse and SWT are both 64bit-versions too.
What am I missing?
In case you have a module-info.java file in the default package, delete it.
Having a module-info.java file enables the optional use of the Java Platform Module System (JPMS) which requires to specify all required modules.
Instead of deleting module-info.java you can also:
In the Java Build Path move the org.eclipse.swt project from the Classpath to the Modulepath
In module-info.java add the line requires org.eclipse.swt;
Related
I opened a project in NetBeans, it is a Maven-based project and i have a problem with javafx imports. There is a communique f.e.: "package javafx.animation does not exist".
Normally when I create a new JavaFX projekt I select the Java with Ant > Java Aplication and then when I right click on my project on the projects list I choose Properties and in the Libraries section I can add JavaFX library.
In this case, when I open maven-based project there is not Libraries section in the properties and I don't know how to add the JavaFX library?
Instructions for using JavaFX with Maven and Gradle-based projects are found here:
https://openjfx.io/openjfx-docs/
I suspect you are running on a JDK that does not have JavaFX modules included. That is normal. However, there are some builds of OpenJDK that include the JavaFX modules so you don't have to add them manually. Using such a JDK may make things easier.
Consider one of the OpenJDK builds from Azul or Bellsoft that includes JavaFX.
For Bellsoft choose the "Full JDK":
https://bell-sw.com/pages/downloads/
For Azul choose "JDK FX" as the "package":
https://www.azul.com/downloads/zulu-community/?package=jdk
I installed Eclipse and downloaded the OpenJFX SDK. But the problem is that Eclipse marks all -fx- properties in the .css file as warning and writes "unknown property". My JavaFX projects compile and run fine - I followed the instructions on the official JavaFX website. But CSS auto-completion has no properties. In addition, when I add the JavaFX SDK Library to the Build Path, it does not appear in Project Explorer, maybe this is due. Also I have installed e(fx)clipse.
Solution:
Delete e(fx)clipse plugin; try to install again from
http://download.eclipse.org/efxclipse/updates-released/3.6.0/site
https://download.eclipse.org/efxclipse/updates-nightly/site
, probably you will be noticed that due unsatisfied dependencies version will be automatically downgraded (3.6.0 -> 3.5.7 in my case). If so, install m2e support from same repository:
I have a project in java on netbeans 7.3 that I need to add more classes to. However, I am working with scala on eclipse. How can I import those classes from my eclipse project and execute them when I run the program on netbeans?
Not sure since I've never really configured stuff - just coded in prepared environments :(
If you are developing a library in your Scala application, i would suggest to use sbt and package the library as a jar and import that jar to your java project.
You will have to define a build file in sbt. I am not sure whether you already defined it and use the sbt package command.
sbt package
Try using sbt
I've a library on which my plugin depends. its been added in the lib directory under the plugin project and added to bin.dir to be shipped with the plugin.
Is there a way to remove it not to be shipped with the plugin and force eclipse to search for it during installation ?
First create a plug-in for your library through the Plug-in from Existing JAR Archives wizard.
Add the new plug-in as a dependency to your plug-in.
During provisioning operations your plug-in won't be installed without it's dependency.
Trying to install your plug-in to an Eclipse installation that does not already contain the library plug-in will fail with an error.
However, this is not usual in the Eclipse world.
Ideally, you should ship both plug-ins as part of a feature.
A Feature is used to package a group of plug-ins together into a
single installable and updatable unit.
I have an existing Java project in Netbeans that uses Swing and I would like to start using Java FX 2.0 for some components in that project.
I have dowloaded the latest version of the JDK (1.7.0_03) and enabled JavaFX but when I try adding an import javafx.xxx statement, Netbeans can't resolve the link. Do I need to manually add some JARs to my list of external libraries?
Project Properties use "JDK 1.7-FX Enabled":
which is configured this way:
If you created your project in older NetBeans it can miss libraries from FX enabled plaftorm.
You can:
either recreate the project in NetBeans 7.1+ and copy sources
or include next library to the libs: C:/Program Files/Oracle/JavaFX 2.0 SDK/rt/lib/jfxrt.jar