• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Using Non Standard Maven Structure stopped working

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey there, I have an existing Java Project that has always been a Maven Project as well.

The structure is:
src
| -> app
| -> logic
| -> model

The top two contain classes while the bottom one contains pictures and FXML files.

I have never had problems with Exporting a Jar from this project until now.

Suddenly, Maven is exporting the classes of my app Package into the top folder "app" within the jar, instead of the src/app folder. However, the src/app folder is created.
The Classes of the logic package are not even exported, but the src/logic folder is created.
The Model package contains all its existing files.

I have never heard of a standard maven directory structure before, since it did never matter and I dont want to re-structure everything now, since it worked before, so why not now?

My pom.xml:



Shouldn't the take care of it?

Thanks for your help
 
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You missed Basic Maven, then.

I'll admit one of the things that kept me using Ant for a long time was that I didn't want to have my project structure dictated to me.

I got over it. It's nice that anyone anywhere can hand me a standard Maven project and I'll know where to thing things and how to build it.

The primary directories in a Maven project are under 2 main trees. The /src directory contains the application and unit test directories (/src/main and /src/test, respectively)

Under each of those directories are language-specific directories for source code and one or 2 directories for non-compiled resources.

In your case, you'd put what you currently have under your /app and /logic directories under /src/main/java. I'll go into detail shortly. Your pictures and other static resources would go under the resources directory: /src/main/resources and /src/test/resources. Instead of, or in addition to resources, a WAR-building POM can use /src/main/webapp, which will be copied into the WAR directory and generally contains web page templates, JavaScript, CSS, and a WEB-INF sub directory

The other main tree is /target. That's where the intermediate and final files are placed when you build. It can be safely deleted, and a "mvn clean" goal will do exactly that, ensuring that only the essential project resources remain in case you want to do a complete from-scratch build or ZIP up the project and send it somewhere.

OK. Let's drag out the old File Manager and rearrange your project to run under standard Maven. I'll use "com.coderanch.example" as my master package root, so that will give me these directories:

/src
  /main
        /java
          /com
             /coderanch
                /example
                   /app
                   /logic
      /resources
              Stuff moved from your /model directory


At that point Maven will build wnat you want without you having to do any special coding in the POM to locate files.

Incidentally, here's what a project of mine keeps under /src/main/java/com/mousetech/gourmetj:
    /persistence
        /service
        /dao
       /model
   /springweb
   /utils
  top-level classes for the app


The 3 persistence subdirectories reflect my standard way of implementing JPA, with top-level persistence in the service package, per-table DAOs in the dao package and the Entity Models in the model package. This app is based on JavaServer Faces, but also uses Spring Web for functions that JSF isn't good at. Normally I'd have a subdirectory for the backing beans as well, but this was an experimental project so I just dumped them in the top level app class directory.
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:You missed Basic Maven, then.

I'll admit one of the things that kept me using Ant for a long time was that I didn't want to have my project structure dictated to me.

I got over it. It's nice that anyone anywhere can hand me a standard Maven project and I'll know where to thing things and how to build it.

The primary directories in a Maven project are under 2 main trees. The /src directory contains the application and unit test directories (/src/main and /src/test, respectively)

Under each of those directories are language-specific directories for source code and one or 2 directories for non-compiled resources.

In your case, you'd put what you currently have under your /app and /logic directories under /src/main/java. I'll go into detail shortly. Your pictures and other static resources would go under the resources directory: /src/main/resources and /src/test/resources. Instead of, or in addition to resources, a WAR-building POM can use /src/main/webapp, which will be copied into the WAR directory and generally contains web page templates, JavaScript, CSS, and a WEB-INF sub directory

The other main tree is /target. That's where the intermediate and final files are placed when you build. It can be safely deleted, and a "mvn clean" goal will do exactly that, ensuring that only the essential project resources remain in case you want to do a complete from-scratch build or ZIP up the project and send it somewhere.

OK. Let's drag out the old File Manager and rearrange your project to run under standard Maven. I'll use "com.coderanch.example" as my master package root, so that will give me these directories:

/src
  /main
        /java
          /com
             /coderanch
                /example
                   /app
                   /logic
      /resources
              Stuff moved from your /model directory


At that point Maven will build wnat you want without you having to do any special coding in the POM to locate files.

Incidentally, here's what a project of mine keeps under /src/main/java/com/mousetech/gourmetj:
    /persistence
        /service
        /dao
       /model
   /springweb
   /utils
  top-level classes for the app


The 3 persistence subdirectories reflect my standard way of implementing JPA, with top-level persistence in the service package, per-table DAOs in the dao package and the Entity Models in the model package. This app is based on JavaServer Faces, but also uses Spring Web for functions that JSF isn't good at. Normally I'd have a subdirectory for the backing beans as well, but this was an experimental project so I just dumped them in the top level app class directory.



Hi, thanks for your reply and also merry christmas.

I created a new Project with the structure you described.

main/java/app
main/java/logic
main/resources (containing all model files)

I also removed the
part of my pom, however upon doing that, my Eclipse no longer shows my my classes and I cannot launch it, so I kept that.

However, now I got a src folder in my exported jar, containing as much as before, just with the different structure.
And in the root directory is a "main" folder now, containing app and logic  with the corresponding classes, which again does not work.
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your picture does not display.

But your test doesn't appear to be correct. Source code must be in package-structure form under /src/main/java for app source and /src/test/java for test code.

You seem to have placed your code under /main, not /src/main, and unless  your package names really are "app" and "logic", that part is wrong also. Recommended package names resemble bottom-up Internet domain names, so for example, coderanch.com gives a recommended package path of com.coderanch and thus a Maven source code directory structure of /src/main/java/com/coderanch (or for Windows, \src\main\java\com\coderanch.). Package name components should be all lowercase characters.

If you don't have an appropriate commercial domain name, there are other conventions. For example, edu.ucf.cop0121.tholloway.assignment6. We can give you more guidance on package structure if you need it, but package structure requirements for Java are the same regardless of whether you use Maven or not. Maven only pre-determines the base of the package source.
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:Your picture does not display.

But your test doesn't appear to be correct. Source code must be in package-structure form under /src/main/java for app source and /src/test/java for test code.

You seem to have placed your code under /main, not /src/main, and unless  your package names really are "app" and "logic", that part is wrong also. Recommended package names resemble bottom-up Internet domain names, so for example, coderanch.com gives a recommended package path of com.coderanch and thus a Maven source code directory structure of /src/main/java/com/coderanch (or for Windows, \src\main\java\com\coderanch.). Package name components should be all lowercase characters.

If you don't have an appropriate commercial domain name, there are other conventions. For example, edu.ucf.cop0121.tholloway.assignment6. We can give you more guidance on package structure if you need it, but package structure requirements for Java are the same regardless of whether you use Maven or not. Maven only pre-determines the base of the package source.



Yes those are indeed my package names.
I attached an image of my structure
Unbenannt.png
Structure
Structure
2.png
[Thumbnail for 2.png]
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't have to quote everything I say. In fact, it makes the thread harder to follow when everything is constantly repeated. Also, where possible, use text copy/paste instead of screen captures. It saves storage space on the server and doesn't turn invisible when someone tries to enter a reply post.

OK. As I read this file structure, your App.java, Main.java, and other files under "app" should contain a "package app;" line so that the compiler will properly map the code. Similarly for the "logic" package. Given that, and a POM defined as a WAR POM, the command:

mvn clean compile war:war

Should create a WAR file under the target directory where the classes will be in its /WEB-INF/classes directory and its dependencies in the /WEB-INF/lib directory. Files and directories /src/main/resources should be copied into the WAR's root.
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm. Just looked at your POM and it is not set up to build a WAR. You need this:

Put it somewhere around your artifactId.

You probably need this added to your plugins:

Version number may need to change - I got that from an old project.
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:Hmmm. Just looked at your POM and it is not set up to build a WAR. You need this:

Put it somewhere around your artifactId.

You probably need this added to your plugins:

Version number may need to change - I got that from an old project.



The current version is 3.3.2 now.

I added that, however the classes are still exported to main/app and main/logic :/
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Remove that sourceDirectory stanza from your POM.

2. Make sure that you have the packaging stanza value set to "war"

3. Tell Maven to build for the "war" goal. "war:war" indicates a WAR file which will be placed in the target directory. There are other "war" sub-goals but that one is best to start with.
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:1. Remove that sourceDirectory stanza from your POM.

2. Make sure that you have the packaging stanza value set to "war"

3. Tell Maven to build for the "war" goal. "war:war" indicates a WAR file which will be placed in the target directory. There are other "war" sub-goals but that one is best to start with.



Okay, but keep the resource directory specified in the pom?

I usually export my Jars via Export -> Runnable Jar
When I run it as Maven build and set "war:war" as goal, I get the Error "webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)".
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remove all of this:

You are building a webapp, so you should not be building a JAR, you should be building a WAR. Exportable or not.

I don't recommend using your IDE to run Maven here until you understand it from the command line. The IDE will make more sense when you do.

Also, run the "mvn clean" goal to get rid of any dirt in the project before you build the WAR.
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:Remove all of this:

You are building a webapp, so you should not be building a JAR, you should be building a WAR. Exportable or not.

I don't recommend using your IDE to run Maven here until you understand it from the command line. The IDE will make more sense when you do.

Also, run the "mvn clean" goal to get rid of any dirt in the project before you build the WAR.



I Installed Maven, used "mvn compile war:war".
Same Error as in the IDE "webxml attribute is required"

Edit: I just added

and it built successfully. thats fine?
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds OK to me, but it may indicate you need a newer version of the WAR plugin.

Originally, you needed a web.xml file (technically known as container-independent deployment descriptor) to configure your webapp and so not having one (ideally as /src/main/webapp/WEB-INF/web.xml) would indicate a defective build configuration. But for many years now, the web.xml file has not been necessary since the information it contained can be extracted from annotations on the source code. So these days the only time it should be complaining is if there is neither web.xml nor annotations.
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:Sounds OK to me, but it may indicate you need a newer version of the WAR plugin.

Originally, you needed a web.xml file (technically known as container-independent deployment descriptor) to configure your webapp and so not having one (ideally as /src/main/webapp/WEB-INF/web.xml) would indicate a defective build configuration. But for many years now, the web.xml file has not been necessary since the information it contained can be extracted from annotations on the source code. So these days the only time it should be complaining is if there is neither web.xml nor annotations.



Okay, then what do I do now since the war file is created? : D
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jannik Joos wrote:
Okay, then what do I do now since the war file is created? : D



Deploy it to a webapp server and test it. Which webapp server — Tomcat, jetty, Wildfly, WebSphere, WebLogic, whatever — that's your choice. We have forums to help with all of those.
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:

Jannik Joos wrote:
Okay, then what do I do now since the war file is created? : D



Deploy it to a webapp server and test it. Which webapp server — Tomcat, jetty, Wildfly, WebSphere, WebLogic, whatever — that's your choice. We have forums to help with all of those.



I do not understand why  I need it, since I am not creating a webapp actually...
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It certainly looked like a webapp to me. That's why I told you how to build it as a webapp.
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:It certainly looked like a webapp to me. That's why I told you how to build it as a webapp.



Oh my bad then xD
Its a JavaFX GUI Application.
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now that you mention it, it has a class named "Main". Sorry.

Change the "packaging" from "war" to "jar", remove the failOnMissingwebxml. then build:

mvn clean compile jar:jar

This isn't a self-executing JAR, I don't think, so you'd have to run it using something like "java -jar target/BMAnalyze-0.0.1-SNAPSHOT.jar" and you may need to give the additional argument "app.Main" if you don't have a META-INF Main-Class directive in the JAR you build.
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:Now that you mention it, it has a class named "Main". Sorry.

Change the "packaging" from "war" to "jar", remove the failOnMissingwebxml. then build:

mvn clean compile jar:jar

This isn't a self-executing JAR, I don't think, so you'd have to run it using something like "java -jar target/BMAnalyze-0.0.1-SNAPSHOT.jar" and you may need to give the additional argument "app.Main" if you don't have a META-INF Main-Class directive in the JAR you build.



Okay. Since I need a runnable jar with all dependencies, I found the maven assembly plugin.
I packaged everything and I get the same result as when I do it in my IDE now.

The jar does not contain a src folder.
Only main/java/logic and main/java/app.
The resources are located in the root directory without a folder.

This is so frustrating, it used to work before, without even doing any structure stuff

This is my pom now:

 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JAR should not contain a src or main folder. The top-level folders should be "app" and "logic" for the classes. For a JAR, the classpath root is also the root of the JAR, unlike WARs, which put their classes under WEB-INF/classes.

If that is not what you are seeing, post an updated copy of your POM (with code tags).

Note that unless you build a self-executing JAR (which requires extra Maven plugins), any dependency JARs copied into the target JAR will not be usable by the application. That is a Java limitation, not a Maven one.
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:The JAR should not contain a src or main folder. The top-level folders should be "app" and "logic" for the classes. For a JAR, the classpath root is also the root of the JAR, unlike WARs, which put their classes under WEB-INF/classes.

If that is not what you are seeing, post an updated copy of your POM (with code tags).

Note that unless you build a self-executing JAR (which requires extra Maven plugins), any dependency JARs copied into the target JAR will not be usable by the application. That is a Java limitation, not a Maven one.



I added my pom at the previous reply.
My old (working) jar had indeed app and logic as top level folders, I never checked on that.
Model was also a top level folder.
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. Eventually I'll manage to see what's in front of me (I hope!). That does look like a project for a self-executing JAR.

One thing I can't quite tell though is it looks like your POM is inside the src directory. That's not what it should be. The POM should be in the project root along with the src and target directories. You shouldn't need the bin directory any more.

Since you are using Exlipse as your IDE and Eclipse will automatically compile classes when you edit them, you do need to adjust the Project Properties. In Eclipse, you can set the source and test source directories as well as the class output directories to reflect where Maven expects them. Eclipse won't automatically do that itself if you created the project as a non-Maven project.
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:OK. Eventually I'll manage to see what's in front of me (I hope!). That does look like a project for a self-executing JAR.

One thing I can't quite tell though is it looks like your POM is inside the src directory. That's not what it should be. The POM should be in the project root along with the src and target directories. You shouldn't need the bin directory any more.

Since you are using Exlipse as your IDE and Eclipse will automatically compile classes when you edit them, you do need to adjust the Project Properties. In Eclipse, you can set the source and test source directories as well as the class output directories to reflect where Maven expects them. Eclipse won't automatically do that itself if you created the project as a non-Maven project.



For now, I am using the standalone Maven outside of Eclipse for testing.
The pom is not in the src folder too.
Also, I was able to create a runnable Jar via mvn package. It just does not work since the expected structure of resources etc is not there.
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Update:

I took my old project structure (non maven standard) and exported a runnable jar again. It works again.
I dont know why.
app, logic and model are now created as individual folders in the root again and I get no exceptions on launch.
I also do no longer have the specifying of the src folder in the pom, which I had before.
 
Sheriff
Posts: 4640
582
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've read through the previous posts, but it is still not  clear (to me).  Do you have a directory under src named main.java.app, or do you have a directory named main which contains a directory named java which contains a directory named app?


 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ron McLeod wrote:I've read through the previous posts, but it is still not  clear (to me).  Do you have a directory under src named main.java.app, or do you have a directory named main which contains a directory named java which contains a directory named app?




Eclipse put that name after I created the structure you advised.
The actual folder is the second what you said, src/main/java/app
 
Ron McLeod
Sheriff
Posts: 4640
582
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jannik Joos wrote:The actual folder is the second what you said, src/main/java/app


Did you verify by checking the in the file system?

I have an older version of Eclipse, but this is what I would expect, and what I do see:



 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ron McLeod wrote:

Jannik Joos wrote:The actual folder is the second what you said, src/main/java/app


Did you verify by checking the in the file system?

I have an older version of Eclipse, but this is what I would expect, and what I do see:





Did you miss my earlier reply? I solved the problem.
But yes I had 2 different results in eclipse, one where it would have normal names and one with . seperated for some reason.
Thanks for your help anyway!
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A note on Eclipse icons. The folder-with-a-grid icon indicates a source directory. A grid-only icon indicates a package. Ron's icons show how Eclipse needs to be configured, but as I said, that's not the default for basic (non-Maven) Eclipse projects, so you'd need to edit project properties to set the source and test folders as required as well as the compiled classes folder(s).
ProjectPaths.jpg
Maven Project Configuration in Eclipse
Maven Project Configuration in Eclipse
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:A note on Eclipse icons. The folder-with-a-grid icon indicates a source directory. A grid-only icon indicates a package. Ron's icons show how Eclipse needs to be configured, but as I said, that's not the default for basic (non-Maven) Eclipse projects, so you'd need to edit project properties to set the source and test folders as required as well as the compiled classes folder(s).



This is working for my case and looks like this.
The src folder is set to "use as src folder".
The model folder is just a normal package within sources, not specified as "sources" particularly.
1.png
[Thumbnail for 1.png]
2.png
[Thumbnail for 2.png]
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, but you just undid all the advice we gave, didn't you? "/src" is what Eclipse uses as a default when it's a non-Maven project.
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:Yes, but you just undid all the advice we gave, didn't you? "/src" is what Eclipse uses as a default when it's a non-Maven project.



Well I didnt undo it, I have a copy of it : D
But it did not work so I dont see the point of putting more work into it, since it now works like before (idk why but it does ._.)
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IDK why but it does is a rather precarious position, though. It basically means "it's likely to break again and I still won't know how to fix it".

If it works, fine, but just for giggles I recommend that you also take the standardized Maven project setup we've been suggesting and see if you can't get it working just so you'll understand it better. You never know when Elon Musk may make a big-money offer to you if you can get some Maven-based Twitter components working again.

And don't forget that screenshot I posted about how Eclipse wants its source and class directories configured!
 
Jannik Joos
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:IDK why but it does is a rather precarious position, though. It basically means "it's likely to break again and I still won't know how to fix it".

If it works, fine, but just for giggles I recommend that you also take the standardized Maven project setup we've been suggesting and see if you can't get it working just so you'll understand it better. You never know when Elon Musk may make a big-money offer to you if you can get some Maven-based Twitter components working again.

And don't forget that screenshot I posted about how Eclipse wants its source and class directories configured!



Yes, thank you : 3
And also, Im not a Programmer/Software Developer of any kind, so thats unlikely to happen :P
 
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic