How to make a standalone application in java [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I use eclipse to run my java code, but I want to make an application that won't use eclipse to run. I want to make it work as a portable stand alone application that only uses the libraries I need.

Right click on Projectfolder (in Eclipse) -> Export -> Java -> runnable JAR -> choose class with main method. Done ;)

I'm going to assume you mean to create a .exe file. for this you'll need a .jar file.
I'm not familiar with Eclipse I know that Netbeans makes the .jar file automatically once the code is compiled.
(For Netbeans)
This .jar file can be found in the dist folder. In case there is none see here to fix that.
In case Eclipse puts into a different folder I'd just look in all the folders related to the project until you find a file with a .jar extension.
Once you have the .jar file you'll need to run an application to change it from .jar to .exe , I would recommend Launch4j.
Here's a handy tutorial to help you with that application if you get stuck.
I know this isn't exactly the answer you're looking for but it's close! Hope this helps!

Related

How can I make project in java [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 months ago.
Improve this question
We have to do java project like a management system and we have source code but the question is how to run it and where? anyone knows?
Queries
IDE
How to run it?
If you already have the source code,
Open a command prompt window then cd to the directory where you saved the java program.
For example, JavaProgram.java is in C:/
Type 'javac JavaProgram.java' and enter to compile your code.
Now type 'java JavaProgram' to run your program.
You will be able to see the result printed on the window.
Good luck :)
we have source code
You'll need to compile it.
Then you need to execute it. That could involve web containers with WAR or standalone, executable Java JARs, or directly execute a class file. Without seeing your code it's hard to answer that, but you wouldn't use an IDE to actually deploy/run your code outside of individual development.
You'll also need some server to run it on. That's not unique to Java.
Regarding the original question: "Make a project" - you could use Maven Archetypes or Spring and Quarkus have project starter websites, for example...

Spring Installation on Mac [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I'm learning spring before I learn spring-boot I wish to install spring from Spring.
I have downloaded and unzipped, I need help as to where to place the folder so I can start working using a import org.springframework.stereotype.Component on a Mac. I know this is trivial question but I haven't found an installation of this kind, majority of the tutorials use spring.io to generate a zip file, or use maven to do the installation.
Looks like you need to use a build tool like Maven or Gradle to have the ability to add Spring Core to your project.
otherwise, you need to download the jar file and add it to the classpath.
Firstly let me tell you about CLASSPATH, according to the oracle website The Classpath tells the JDK tool where to find third-party and user defined classes that are not extensions or part of the Java platform.
On a Mac you need to type echo $CLASSPATH to see if you have any CLASSPATH set up, if you have never worked with third party classes this will be blank.
To add to CLASSPATH run the following command in the terminal
export CLASSPATH=/Users/{Path} this will clear all the classpaths , if you want to add to existing classpath run export CLASSPATH={$CLASSPATH}:/Users/{Path}
You can find a detailed article on this topic here

how to use a processing library in eclipse? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am trying to play an audio file in a java program I have written in Eclipse. Processing has a very good library for playing audio files which I would like to use in Eclipse. I have followed and completed the directions in this link:
https://processing.org/tutorials/eclipse/ to be able to write Processing java code in Eclipse. I am unclear how one goes about downloading and using Processing libraries in Eclipse. All ideas and links explaining how to download and use this java library: https://processing.org/reference/libraries/sound/index.html in Eclipse would be much appreciated! Thank you for your help!
You'd follow pretty much the same steps- add the library jar(s) to your classpath, and then use the classes in those jars.
For example, if you want to use the Processing library minim, you would simply download the zip file, and then extract the jars within to whatever directory you want. Then you'd right-click your project in eclipse, go to properties, then Java build path. Go to the libraries tab, then just select the minim jar(s) to add them to your classpath.
Then you can use the minim classes just like you can use any other Java library.

Eclipse does not recognize code changes [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Just note that I am looking for possible solutions for more then couple of hours. I saw similar problems on Stack Overflow but this just not work.
Ok so I have created a Dynamic Web Project in Eclipse Kepler. Later I shared everything with my team mate. Problem arises when he is trying to change one of the classes. He changed private field to something else. But when he restart tomcat server republish code he got an exception that path to the file is invalid. But he changed that!!!
Eclipse still thinks that variable has an old value.
Any idea how to fix it? We restarted eclipse multiple times, restarted tomcat server.
Make sure Eclipse actually builds the class file. JSP files are compiled by the web server at runtime, so changes there might work.
Look at the file system, make sure that the time stamps of all the .class files change when you save a change in Eclipse.
What do you mean by shared? If you are using some sort of source control application, the problem is most likely there. Quick fix if you are pressed for time would be just copying the entire project directory, and creating a project from said directory. Also, tomcat has a tendency to not 'update' your deployed project for some reason. If, however, you kill the work/catalina folder and re deploy your project it should work.
Remove the project from your container, clean the container and redeploy the project

How to remove obsolete java classfiles? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Every time I need to delete the previous files to force the compiler not cache
I compile it using:
javac Main.java
and other imported files are nor compiled, until deleted
Of course you don't want ALL imported classes to be deleted (java.lang?) but only your project. Simple: Delete all .class files in your output folder, recursively, with your shell's tools. If you have a dedicated output folder you can just delete the whole folder.
Best method: Learn a build tool like Maven or Ant and use the integrated ways to clean a project output, e.g. with Maven mvn clean. Or if you use an IDE with a built-in builder (e.g. Eclipse) there might be a clean option for the project.
This is not a "cache" in a strict sense.

Categories

Resources