Netbeans project in Eclipse - java

I am Java beginner. I have developed only two Java desktop applications and I use Eclipse as IDE. Right now I wanted to work on this project https://nbjfuguesupport.dev.java.net/
All code is in Netbeans. I suceeded to import all libraries that are used in source files in eclipse, and I have no errors showing in code in Eclipse. The problem is that I don't know how to run that code from eclipse. I don't know which class has main method.
Using google I found out that Netbeans uses org.netbeans.core.startup.Main.main to start projects, but I cant't find this in my libraries. Does anyone know in which .jar does this class come with netbeans 5.5 files. ??
Regards.
P.S. I must use Eclipse because I have a team of 3 men who have also only used Eclipse in the past, and we need this code to help us in similar project for college.

You can find the core.jar file that contains Main class under:
C:\Program Files\NetBeans 5.5\platform10\core\
You can simply include that in your Eclipse Java Build path.

Related

Deploying a NetBeans application with JavaFX

I am attempting to build an application in NetBeans that can be deployed to and end user. I am still pretty new to deploying projects and this is by far the most complicated one I have done so please bear with me. I currently have a working application in NetBeans which utilizes JDK 15 and JavaFX 15. As long as I run things inside of NetBeans everything works as intended. I have reached a point where I want to make sure I can distribute this application outside of NetBeans. To this end I did some searching and found the following tutorial.
https://netbeans.org/kb/articles/javase-deploy.html
I was able to follow the tutorial and build the example. The build works in NetBeans, I am able to run the executable jar file in the dist folder from the command line, and I am able to run the jar file by executing it from the file explorer. Now when I attempt to do the same process with my own project I run into the following errors.
When I attempt to run the jar file in the dist folder absolutely nothing happens.
When I attempt to run the jar file from the command line using the command
java -jar "C:\Workspace\HandyAndyVersion1_2\dist\HandyAndyVersion1_2.jar"
I receive the following error,
Error: JavaFX runtime components are missing, and are required to run this application.
I am currently under the assumption that the first problem is a by product of the second. If anybody has a solution to this problem or any ideas on what I could have configured wrong please let me know and thank you all in advance.
To package a Java desktop application these days, you should be using the jpackage tool and optionally the jlink tool. These will generate a JRE image that is packaged with the application and contains the modules you need.
I suspect the issue you are running into is that the native libraries for JavaFX are not present. Most distributions of JDK 15 do not contain the JavaFX modules, though some do. (See the Full and FX bundles of the JDK from Azul and Bellsoft). I find it is easier to use a JDK with JavaFX bundled rather than have to manage a separate module path during development for the jmod files of JavaFX, but that is another option. Either method can be used with jlink to create a suitable JRE for your application that includes the JavaFX modules.

AppleScriptEngine in java jar is not working, what am I missing?

I am trying to incorporate Apple's script engine in my java app developed for macOs. I use eclipse to develop and when I run a debug build from eclipse all the Apple Script functions work.
As soon as I export it to an external jar and run that on the same machine they do no longer work.
I've searched and found some issues which I all tried, here is a summary:
using getEngineByName("AppleScriptEngine") now.
Adding the META-INF file javax.script.ScriptEngineFactory with the contents: apple.applescript.AppleScriptEngineFactory
cleaning and rebuilding several times
I opened the jar to see if the META-INF file is present and it is.
searched in /System/Library/Java/Extensions/ for a applescript jar file but it was not there.
I also searched for the /Library/Java/JavaVirtualMachines to see if it is there but also not the case
It is still not working. So I do not know what the difference is exactly between eclipse debug run and running a jar in macOs but there has to be something I am missing.
As far as I can figure out it seems that the apple scripting class is not installed but then how does eclipse use it?
As I understand there is a difference between java JRE versions so I am in need of a solution for all of them because I do not know what systems are running my app.
Any help is appreciated!

does eclipse come with inbuilt package javax.sound.sampled.*?

I'm currently using Eclipse Kepler for JAVA application development.
I want to create an application that can play sound.
Most of solution available on stackoverflow are using javax.sound.sampled* package. But i did not find it in my eclipse.
Is this package INBUILT ? or is there any way to install this package? Do newer versions of eclipse have this package?
Just update your Eclipse.
Steps:
-Go to Help Option in the Menu Bar
-Click on "Check for updates"
-After it is successfully updated, you will get sound package.
It worked for me.

How can I add Java Template Project in Xcode 4?

I wanna know how can I add Java Template Project in Xcode 4.
I'm working with Eclipse and it's really fine but i want to write Java program in Xcode.
Thanks for helping. ;)
Java is not a first class citizen of Xcode anymore, so you should in my opinion stay with Eclipse.
I realise this question is 6 years old, but I have a similar problem and found what seems an easy solution. I have an old Java project (2008-9) which I maintain but has been dormant. As I prefer to keep it into Xcode I transferred the whole project (sources, project files and all paraphernalia) to a new development machine running el Capitan with Xcode 7.3.1. I opened the project (which was still in 3.1 version) with it, and tried to build it. It failed as Ant was missing. So I downloaded Ant (version 1.10.1) and copied its bin and lib directories under /usr/local/ant, then I changed the project external build tool configuration (under project, go to Info, and you'll see that parameter) which was set to /usr/bin/ant and set it to /usr/local/ant/bin/ant or wherever you put it. Build again and this time it worked.

importing NetBeans (Desktop Applications) into Eclipse

I'm wondering if I can import NetBeans projects (especially desktop applications) into Eclipse, that I have a NetBeans project which is a desktop application and I want to run it in Eclipse.. is that possible ? because I've searched, but no clear answers has showed up :(
Info :
Platform : Mac OS 10.6.5
NetBeans : 6.5
Eclipse : 3.3.2
Java : JDK 1.6
Thanks in advance
When you say Desktop Applications it sounds like you have designed the GUI using the Netbeans tools, and the generated Java files should run nicely, but you will not be able to edit them freely and expect Netbeans to like the revised files when you import them back.
SO, in other words, try and see what happens.
Sure, Netbeans and Eclipse are both just IDEs, so you can move code from one to the other easily. The folder structure they use may be a little different, but you should be able to just import the .java (or whatever other language you are using) files.
Create a new project in eclipse and import the *.java files !
Here is a great article on "How to import NetBeans project into Eclipse". I personally found method #2 to be more useful.

Categories

Resources