Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Error when including exports directive into module-info.java and trying to compile it

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it says:



This is the folder structure:

testProject
     |
   mod1
     |_____________________
     |                                     |
   src                             module-info.java
     |
   pkg
     |
 classes
     |
 MyClass.java


MyClass is a simple hello-world program:



and this is the content of module-info.java:


 
Now when I move to folder mod1 and try to compile the module-descriptor by issuing this command:



the following error message is issued:



 

Can anyone help please?
 
Saloon Keeper
Posts: 11923
253
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to put module-info into your src folder (the nameless package) and you must tell the compiler that the src folder goes on the source path, using the --source-path option.
 
Ahmed Sabrioglu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thumbs up. it works. Thanks alot.
 
You ridiculous clown, did you think you could get away with it? This is my favorite tiny ad!
ScroogeXHTML 8.7 - RTF to HTML5 and XHTML converter
https://coderanch.com/t/730700/ScroogeXHTML-RTF-HTML-XHTML-converter
    Bookmark Topic Watch Topic
  • New Topic