Jar file from desktop libgdx project in netbeans - java

How can I get a jar file from a desktop libgdx project in netbeans?

I know it's a bit late and you've probably figured it out by now, but I'll still answer this for those who don't know.
Right click on your desktop project
Go to the "Tasks" menu
Click "dist"
This will create a standalone JAR file in <pathToYourProject>\desktop\build\libs called desktop-1.0.jar (or something like that).
I don't know if that's the proper way to do it, but it's the only one that worked for me.

I have no experience with this but you should be able to unpack/extract the jar file and then load then load the project into Netbeans.
If it's a gradle project.
If it's not search further since I do not know Netbeans.
Import it with Android Studio and work with my favorite IDE. Choose import none android studio project.

Related

Why Eclipse duplicate folders and files?

I'm trying to test Eventuate (framework JAVA that implement event sourcing) But I have a huge feature with eclipse, when I imported the project eclipse display the same files a lot of time.
For information the project is a spring-boot project using gradle.
This is a screen shot:
Would do you have an idea why this happens ?
Use the Package Explorer instead of the Project Explorer, and you won't get the second duplicate.

How to install SWT for eclipse Kepler

I recently downloaded eclipse Kepler to learn to use SWT, I also downloaded the SWT zip folder.
The instructions on eclipse web site states that I should import the zip folder to Existing Projects into Workspace. I have done this, but no project shows on the Projects form field, I have been googling since morning to get info on how to install SWT on Eclipse Kepler but I have not found any help.
Please I need help on this, as I am faced with a project that needs rich look and feel. All replies would be greatly appreciated. Thanks to all.
I got it, Ignorance was the case, cos I have never done any SWT before. so this reply is for all those who are as Ignorant as I was.
The jar file representing the SWT library is found in the plugin folder, of the eclipse installation, to add the jar file to a project you would have to follow these steps:
Right Click on the project Name
Select Properties
Choose the Java Build Path from the dialog that appears
select Libraries > click on the Add External JARs...
Select the SWT jar file from the plugins folder in the eclipse folder represented by org.eclipse.swt.windowing_system>_.jar
and click on OK to exit the dialog`,
then you are ready to play

Convert an java file into android program

hi i am a new android developer. When i am searching for a logic related to my app in google, i found a java application which is related to my android app. After making some changes i succeded in getting output, but i need the code to be in an android based project. When i change to convert it i get lot of errors, is there any possible way to convert the java application into an android app by including any external jar file..... The java application is just a part of my android app, based on that i have to develop more so pls help me....
thanx in Advance
If you intend to include external Java code via .jar files, that is supported in Android. Just put the file into the libs/ directory of your Android project and use the classes as you would somewhere else.
If you are using Eclipse IDE, this might help:
After including the .jar files in the libs/ folder, right click on the required .jar file and select "build path", then click on "add to build path". After doing this, u'll notice that the .jar file is added in the "Referenced libraries" in your project. Once done, you are all good to go and import methods from these files. Hope that helps you remove your errors. Happy coding. :)

How can I install httpclient and other libraries in Java so I can use them in Eclipse?

I'm a new Java developer I've only ever done PHP in the past and all the functions I needed to use were built into PHP. This doesn't seem to be the case with Java though!
I downloaded Eclipse and wrote a hello world and some other things and everything is working great for me! I downloaded httpclient (from http://hc.apache.org/downloads.cgi) and I can see two files, httpclient-4.0.2.jar and httpmime-4.0.2.jar but I'm not sure how I can add them into my program and start using them to build something with!
Any help would be appreciated so much and I'm sorry if this comes off as a trolling question of sorts, I'm really new to this!
Hi in any environment weather it be eclipse, jdeveloper, intellj, netbeans or commandline you need to add the downloaded jar files to the classpath/libraries. This is so the JVM know where to look for external libraries.
In Eclipse in the project explorer right click on the root project and go to properties. Then in the left hand list go to Java build path, once selected go to libraries then go to add external libraries. Once selected they should appear in the list next to the button.
hope this helps.
In Eclipse, right click on your project in the Package Explorer and choose Build Path > Add External Archives... Navigate to your jar files, select them, and click Open.

How to import java classes from other projects in NetBeans 6.8?

I have just started playing with Java, and I really like the language. I am using the NetBeans IDE, and I find one odd oversight. I can create a new class in a project, but NetBeans doesn't appear to support any way to import an existing class into a project.
I manage to get it done by going to some other project where the desired class already occurs, and then I copy/paste it into the source code folder of the new project, then change the package name at the top of the pasted file to match the package name of the new project.
Is there a nice direct way to do this from the NetBeans interface?
Thanks for any help on this.
In the Projects window you can expand the project that you are working on. Right Click on Libraries and select Add Project.... You will get a dialog allowing you to select another Netbeans Project with the Java classes that you wish to use.
You have to just make the .jar file of that/those java files which you want to use in another project.
right click on file->export->java->.jar then finish.
Now you can use these jar into your another project.
When you build the java project in netbeans it creates a jar file on the dist folder in the current project directory.
You can use this jar file for the other project as a package by adding this as ADD jar in the next project.I have tried this ,i am using my old project jar file for new project development.
Use the 'Clean and build' your project option from the netbeans application, that creates the 'dist' folder which you are looking for (and obviously can't find because you havn't cleaned&buld)
The netbeans itself creates .jar files and you can add the jar file to the current project you are working on.

Categories