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
Related
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...
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I created an Java application under the use of Eclipse. Now the application will be running in production. However, if there should be a change in near future, another user of my department should be able to grab the code and improve it.
How would we achieve this, without any versioning software / repository (like SVN ors so)?
Is it a good practice for such a small bit of code, to just export the project as ZIP File and others just import them into their workspace?
It is not a best practice to not use any version control software.
However, if you really want to do it there are many ways. One way I would say is by using a shared folder (assuming that you all are on the same network).
Right click on your Project on Eclipse, then export to your localhost, zip the code and copy it to the shared folder. If your folder is shared on network, others can get the updated code anytime they need it once you update the shared folder. But whoever gets the code will have to make sure that their localhost workspace is updated properly.
I would suggest, you create folders inside the shared folder like dev/tst/stg/prod and copy the code accordingly. And also make sure that you are not replacing any previous stable code in case if you want to revert the changes.
For instance, if it is dev then create a folder with today's date and copy the code changes done today so that it will be easy for any new person to get the latest code and work on.
If you are not on the same network but both got access to internet then you may use Dropbox to share the code. Hope my response help you.
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 years ago.
Improve this question
When do we need to attach source to a jar?
Can we debug without attaching the source code?
Can we see the stacktrace line numbers without the source (AFIAK we can't)?
What is the best practice for local builds? Do we need the source code?
What about CI?
Can we leave the source code only for production release?
Thanks,
Omer
It's good practice to also publish the sources jar along with your binary jar in your internal (or external) Maven repository. It makes life of the developer that is working with your code much easier since they can see your comments / browse the codebase and be able to have all that at debug time. Now as you are saying even if the sources jar is not published, developers have ways around it primarily relying on their IDE. In Eclipse for instance you can install the Java Decompile plugin that would give you access to the code during debug time or on IntelliJ there is something similar without the need of installing a plugin.
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 6 years ago.
Improve this question
I'm trying to import an Eclipse project from GitHub into IntelliJ. I'm however having problems figuring out the correct way of doing that.
I'm following this question to do the importing(I'm leaving everything on default and simply click "Next", since the answer doesn't mention anything else and I have no idea what the other stuff does), but it still doesn't work. The configuration/project structure appears to be seriously broken and I have no idea why.
More exactly, I'm currently stuck at the following screen: The "Problems" tag explains in more detail that both the things in red are "invalid". I tried searching for that error, but it seems that people encounter it on all different project models and build tools like Maven, Spring, or Android. None of them concern Eclipse projects and the solutions vary from issuing a bunch of commands that I don't understand somewhere to deleting this project file or another.
Since there are so many unknowns in play here, I decided to ask, rather than waste days crapshooting only to break something in my IDE or Java installation. How do I get this project to work? It's a simple local machine visual app, it shouldn't be this complicated to import it in an IDE.
Basically the issue is how those two libraries are defined. If you select one and then click on the edit button to the right, a dialog will open and show the path to where those libraries are defined. They are likely configured to find the necessary JARs at a specific path on the (original developers) system. For example, for the jfxrt.jar library, maybe it is configured that the classes/binary JAR is at C:\Program Files\Java\JavaFx\jfxrt.jar or C:\Users\Bob\libs\fx\jfxrt.jar. Wherever they are defined, you either need to put the necessary JARs in that directory, or modify the config to point to the location on your system where you have the JARs. This of course may require you to download the necessary JARs.
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 6 years ago.
Improve this question
A file is generated dynamically at run time through one of the methods and is persisted in resources. As soon as the file is generated, the server automatically restarts as it detects a change in the File System.
Although, I know it's an anti pattern to save the file in the project directory itself, but the project demands of such feature and there is no escape at the moment.
Is there any way to prevent the restart of the server if any of the files are generated / modified specifically in resources; i.e. Ignoring the resources directory.
Build tool is Maven and editor: Intellij.
Can spring-boot-devtools be the reason for the restart? I tried adding spring.devtools.restart.enabled: false in property.yml file but without any luck.
I think you should save the file somewhere outside your project mainly because resource folder is a standard maven folder and it's bundled into the war when you deploy. When you save a file it's saved into the file system only. However the file won't be available in your already packaged war bundle. That's why you are able to see the files after you restart, they will be bundled into the new war every time you restart because maven recompiles them and put them into new war.