Deployment

OK. I am fairly new to the Java world (I have spent most of my time with .NET). I have a project that is running in a Windows environment under the IntelliJ IDE and everything seems to work the way I want. Now I would like to deploy to a Linux Ubuntu server and run the code there. To make sure that it runs what all do I need to copy? I am assuming that I need the compile class that contains 'main' as well as all of the classes that makeup my packages. This brings up my first question cann all of the class files that are part of the packages in the project be somehow combined so I just need to deploy one class file? If not what is the directory structure expected? Or do I just need a CLASSPATH environment variable that includes the classes of my package? Now what about the various jar files that make up the external libraries? What if I want to make my own JAR file? Thanks for help on these rudimentary questions.

0
37 comments
Avatar
Permanently deleted user

No, it should be enough to perform steps 4 and 5.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

So I don't have to worry about moving the manifest folder? Why did I have to move it before?

0
Avatar
Permanently deleted user

Because it was created in wrong folder. If you specify the right folder (main/resources) in 'Create Jar from Modules' dialog at step 4 the manifest.mf
file will be generated in the right place and you won't need to move it.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

So I forgot a step. In the original project there wasn't a resources folder. I had to manually create the resources folder and edit the contents. It is just I put the resources folder in the wrong folder?

0
Avatar
Permanently deleted user

If you specify path to non-existent resources folder in the 'Create Jar from Modules' dialog IDEA will create it for you and place the properly
generated manifest.mf into it.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Now I am really confused. Originally I created an artifact with the defaults. It didn't work. So it was suggested that I create a resources folder so I did. Now you are saying that I didn't need to create the resources folder? Why didn't it work? Somehow Maven got in there and messed things up.

0
Avatar
Permanently deleted user

MANIFEST.MF file should be placed under src/main/resources to be correctly processed by Maven (and IDEA). If you specify this folder in 'Directory for
META-INF/MANIFEST.MF' field in 'Create Jar from Modules' dialog IDEA will automatically create this folder and generate proper MANIFEST.MF file inside
it. If you leave the default value (src/main/java) in this field the MANIFEST.MF file will be generated in the wrong directory and you will need to
move it to the right folder afterwards.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.