I am new to Eclipse and Java programming having mainly worked with Microsoft Visual Studio.
I installed Eclipse (Kepler 4.3) with no issues along with WindowsBuilder and SWT.
I created a new project adding in references to SWT, both WindowsBuilder JARS, and resty. Into the project, I created a new package and selected a SWT composite. I gave appropriate names.
The GUI designer came up with no issues. I added in a couple of controls. The idea is to create a hello world application, display that application, and build it. Eclipse has automatically build checked.
Okay, the IDE in designer view shows the GUI of my Hello World application and the source view the source, so no problems there.
I press Run, and the first time I had to select a run configuration, which I selected EclipseStarter. There was not many options. I click on run and nothing happens.
If I go to the project's bin package folder, I see a file with a ".class" extension.
Why does pressing Run|Run (Ctrl+F11) do nothingness? There is a brief hour glass showing, but then nothing after that.
How do I launch the application from within Eclipse?
Is the generated ".class" file the correct runtime? I double click on that and Windows does not know what to do with it?
The end platform will be CentOS, but Java as I understand things, should be platform independent, so my Hello World application should run on my Windows 7 Pro box just as nicely. (I did not try CentOS yet) as I want to see it work on my desktop and know what file to copy over.
I think you selected the wrong option EclipseStarter.
Try running it as a Standalone Java Application.
It is a Standalone Java Application that you're building, right?
(I mean, the analogue of a Windows Forms App in .NET)
1. I guess because you selected the wrong type.
2. Ctrl+F11 is for Running it, F11 only is for Debugging it.
3. The class file has to be run by a JVM, Windows cannot run it directly,
it is not anything like a native executable or like a .NET assembly
(which Windows 7 knows how to run). But as you're using Eclipse you
already have a JVM.
The solution is multi-fold.
I had to delete Eclipse and install the 32-bit version of everything. That simplified life, as 64-bit caused issues running.
Create a new package
From the toolbar, select "Create new visual classes" drop down. Select "SWT" --> "Application windows".
Create the application window
Press the play button, 8th icon having selected the package first.
That enabled to run my Hello World on Windows. The output is a .java.
I still have a problem running from the command line, but that is a different issue.
Summary: My main issue was creating a SWT application window first and that I should have 32-bit for everything.
Related
I used Eclipse Java last year for a class, and this year I have another class that's requiring us to use Eclipse C. I tried installing the Eclipse C/C++ packages, but when I write in Eclipse it stays in Java. Please help!!!
Also, I don't really want to uninstall Eclipse if I don't have to, because I'm still actively working on projects.
You've basically downloaded 2 "modes" in Eclipse: Java mode, and C/C++ mode. If you type and it assumes it's Java, that's because the project you created is in "Java mode".
First, just quit out of the app and open it again. Maybe the update only enacts when the app is refreshed.
Now go File > New. If it's installed correctly, when you hover over "New", there should be the option "C/C++ Project". If there isn't, double check that you downloaded the correct extension. (Note that I'm on a Mac so the layout might be slightly different for you, but it's the same idea).
So I am attempting to develop a JavaFX program using my favourite editor (Visual Studio Code) and then run that program through the windows 10 Command Prompt Command Line using
javac program.java
then
java program
I am currently running jdk & jre 1.8.0_181 (which I have been told already includes the JavaFX packages) however I keep getting compilation errors saying that the packages dont exist
Error: Package javafx.collections does not exist.
import javafx.collections.*;
^
I am currently in my third year of an information technology degree at university and on my university computers, javafx programs run completely normally just using the commands mentioned above however when I attempt to recreate these on my personal laptop, I get those errors. I know my program has no coding errors because it worked on their version with no compilation/runtime errors. If anyone can suggest any reasons why this may be happening (i.e. there is something I need to do to setup my javafx properly or I need to use a specific command to run the program) it would really help. Thanks.
So I was the one to originally ask the question but I just found a solution that happens to work and for those in the future who have this issue, I uninstalled ALL versions of java that I had running on my computer completely through the "Add or Remove Programs" page. Once done I installed specifically this version of Java (none of the others worked properly for me but this may differ for you): Java SE Development Kit 8u192 (Found at https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html). Once installed, find your Java directory in your Program Files directory "C:\Program Files", and open the jdk folder that you just installed. Get the path to this folder and copy it to the clipboard. Open your control panel, click on "System and Security" (if you cannot find this button, skip to the next step). Click on "System" > "Advanced System Settings" (on the left bar). Click the "Advanced" tab at the top, then "Environmental Variables..." at the bottom. Under "System Variables", look for a variable called JAVA_HOME. If you cannot find it, click "New", enter "JAVA_HOME" into the "Variable Name" field, and enter the path you copied to the clipboard earlier into the "Variable Value" field. Click "OK". Next find the "Path" variable and click edit. Look for a directory in the list similar to "C:\Program Files\Java{some jdk here}\bin". If you find one, click it, click delete on the right and then click new. Then in the created text field, enter "%JAVA_HOME%\bin". Click "OK" until all of the windows we opened are closed. The javac should now work with JavaFX.
I am trying to work with JavaFx for the first time . Right now, I cannot see the option for JavaFx in my preferences window (Eclipse -> Preferences -> JavaFx?) as shown here:
Preferences Window.
I have Java 1.8.0. installed on my mac.
Eclipse itself does not know anything about JavaFX and in fact it does not have to because a JavaFX program is nothing but a plain Java program.
In order to get some additional tooling you can however install this plugin. e(fx)clipse This is helpfull but not necessary to write a JavaFX program in Eclipse.
Sometimes you may need to manually look up the repository.
I used this walkthrough to do it Install efxclipse into eclipse
The actual repository is here (as of Feb 24,2020): http://download.eclipse.org/efxclipse/updates-released/3.0.0/site
You will need to restart your Eclipse instance.
I reinstall my Eclipse environment every year when the new version is released. The most recent release - Juno - however, does not work as expected.
Currently, when I try running demos from Oracle, for example, it asks me to select an Ant file to run before compiling. After creating a blank Ant file to bypass the requirement (which I thought was rather dumb, since I don't think TDD is something that should be forced on people), it still refused to run, saying the "Selection could not be launched."
I understand that Juno is an update from the 3.x track to the 4.x track, but this seems a little ridiculous to me. What can or should I do so I can get Eclipse back up and running again?
Just to clarify:
All files in question are on my Eclipse workspace path
I don't do much in the way of Java development, though I know I'll need to do so soon. Hence, my unfamiliarity with the most recent version of Eclipse.
I would like to run my files & projects without Ant files. I know it has something to do with Run configs, but I don't know how to change them.
Here's what I did to run the demo from Eclipse Juno:
Downloaded the project from http://docs.oracle.com/javase/tutorial/uiswing/examples/zipfiles/components-FrameDemoProject.zip (if this is not the correct demo, then please provide the link you're using)
Unzipped it to my projects directory (not my workspace), so that you have:
PROJECTS_DIR/components-FrameDemoProject/src
PROJECTS_DIR/components-FrameDemoProject/nbproject
PROJECTS_DIR/components-FrameDemoProject/build.xml
From Eclipse, File > New > Java Project
List item Uncheck Use default location and navigate to <PROJECTS_DIR>/components-FrameDemoProject
Hit Finish
Drill down to src/components/FrameDemo.java
Right-click on FrameDemo.java and select Run As > Java Application
Let me know if any of these steps give you trouble.
Take a look at you project properties and select the Builders entry. Do you see an Ant Builder entry? Try to select or create a Java Builder entry instead.
I just created a new Java Project in Juno and added the FrameDemo.java source. In my case, the Java Builder was selected as the default for this new project.
I downloaded NetBeans 6.5 complete pack with Java ME. And then I downloaded and installed Sun Java Wireless Toolkit too. And I have tried in all ways to go to New Project -> And in under Java ME -> Mobile Application
Then I enter name and location.
And then when to select the emulator platform, "Sun Java Wireless Toolkit 2.5.2 for CLDC" is there.
But when I press NEXT nothing happens. A red sign just blinks on the background!
I want to create a jar file to be run on Sony Ericsson phones!
How do I do it?
few things to try:
check/uncheck the "create Hello MIDlet" option
check/uncheck the "set as main project" option
change the project name in case it conflicts with another in the same location
only use basic characters in the project name: [A..Z][a..z][0..9]
make very very sure the project location you're using is correct for your operating system.