100 questions
0
votes
1
answer
39
views
How can I resolve Java package namespace error?
In this error ('package="io'), there has an operator " between ' and '.is it a system error? How do I solve it?
Error:
Namespace 'package="io.flutter.plugin.pathprovider"' is not ...
0
votes
1
answer
34
views
Java Mail project working when running within netbeans but not working when running directly dist/executble jar file
Please help,
javax mail project sending email when running it from netbeans, but when running directly from executable jar file then mail not going. and also not working on any other PC and server.
...
0
votes
1
answer
103
views
How to add non-modular JARs with split packages to a modular JavaFX project in Intellij idea?
My project uses Mapsforge library for displaying maps, and JavaFX for GUI.
There is a way to compile JavaFX with javafx-maven-plugin and stay in the unmodular paradigm, but it seems against the best ...
0
votes
0
answers
94
views
Docker, why does it fail to access my other package in a java program
I'm deeply sorry since the answer may be existing already but I've failed to found it yet and the similar question part of stack overflow pointed me to some python question that doesn't really help me ...
0
votes
2
answers
130
views
Can't import subpackage into another subpackage
I am trying to create a package named myUtil, inside I have two subpackages named Node and BinaryTree.
Inside Node dir, I have Node.java and Node.class, and of course the first line in the java file ...
1
vote
0
answers
180
views
pyspark 'JavaPackage' object is not callable
I want to remove the first row of a dataset but this error keeps occuring: 'JavaPackage' object is not callable.
I've written another simple program for easier review. Here is my code:
# Create a ...
-1
votes
1
answer
1k
views
how to fix java package problem in vs code
# please help me to fix such thing.
when I make a directory and inside such try to write java code this problem occurs. some time it does not give any error but when I run this code, this thing come ...
-1
votes
1
answer
40
views
Why do I get "The method createLL() is undefined for the type LinkedListUse" error when calling from same package in Java?
Class linkedListUse
package linkedlists;
public class LinkedListUse {
public static void main(String[] args) {
// TODO Auto-generated method stub
Node head=createLL();
...
1
vote
1
answer
1k
views
Java Error: Could not find or load main class, Caused by: java.lang.NoClassDefFoundError
Compiled
I've compiled the java code, but I'm not able to run it. I compiled the code with the following:
javac -cp "streamer-client-java.jar:kafka-clients-3.4.0.jar:snappy-java-1.1.10.0.jar:lz4-...
-2
votes
1
answer
104
views
Java OpenGL Syntax
i am new here and have a little problem.
I included OpenGl into eclipse and tried to run a little test program and everything is working fine as it should, but i have a problem with the syntax.
Here ...
-3
votes
2
answers
104
views
What is the first line for, in the MainActivity.java? [duplicate]
package com.mycompany.myapp2;
I want to know what this does for my application.
I am a beginner. I'm trying to learn how to develop an android application.
Thank you ❤️.
1
vote
1
answer
125
views
How to write package-statements for nested packages?
If I have a class in a sub-package like sub-package-name, which is in a parent-package like higher-level-package-name, do I just write
package "sub-package-name";
Or also add the parent-...
0
votes
1
answer
106
views
Error `The declared package "part2.stage2" does not match the expected package ""` with correct package name
So I have a Competitor.java file on path: /home/john/javaStuff/CMTR/src/part2/stage2/Competitor.java. I have VSCode open in the CMTR. So CMTR is my current working directory if that info is necessary.
...
3
votes
2
answers
2k
views
"Error: Package does not exist" ... Where does the JAR file belong? [duplicate]
I'm trying to import a self made package into a Java project. I got it to work once with some test class. So, when I tried to change it to an official, approved class name, the compiling stopped ...
0
votes
0
answers
689
views
How to find package name once Maven dependency is added
I'm attempting to use the socket.io implementation for Java. I need 2 dependencies: 1) Engine.IO Java Server and 2) Socket.IO Server Java. I'm struggling to import the actual Java packages once the ...
1
vote
0
answers
232
views
How to import a java standard class, from a particular java standard package, from a particular java standard jar?
Short Version
How do i do the equivalent of the hypothetical syntax:
import plugin.jar.netscape.javascript.JSObject; //import netscape.javascript.JSObject from plugin.jar
Long Version
I am trying to ...
-1
votes
1
answer
62
views
Why are Spring libraries including same parent packages made seperate?
I've just noticed two different libraries sharing paths.
Example is as follows.
There are two seperate packages - spring-boot-actuator, spring-boot-actuator-autoconfigure.
Packages included in these ...
0
votes
0
answers
62
views
importing class from one file to another file java package does not exist
I have two files:
file1:
package firstclass.dep;
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
final firstclass abc = ...
-1
votes
1
answer
236
views
Can I publish apps on Google Play with different package names?
My question is not if I can upload two apps with the package names <TLD>.<name>.app and <TLD>.<name>.app2. (the app's name changes here)
It is if I can upload 2 apps with the ...
0
votes
0
answers
9
views
Bidirectional reference to parent package in Java [duplicate]
I'm trying to setup a java project with following structure:
[Project]
-parent_class
-Package
-child_class
Importing and refrencing the child_class in the parent_class is no problem so far. The ...
-1
votes
1
answer
462
views
Java how can i create my own methods which are calling via dot operator
For example we have .toString() but we don't have .toStringAndTrim() or .toStringAndReplace(). So I want to create my own methods inside a library and when I import this library I want to access after ...
0
votes
0
answers
87
views
I want to call string parameter from error message class placed in helping package to my test case class of test package
package com.matchmove.helpingfiles;
public class prefundErrorMessages {
public static String error_description_when_special_character_inserted_in_product_code =
"ProductCode: ...
1
vote
2
answers
8k
views
Java Intellj: org.json.simple does not exist
I know that questions have been asked before, but it does not solve my problem in my school project.
I downloaded the JSON.simple jar file from https://mkyong.com/java/json-simple-example-read-and-...
0
votes
1
answer
744
views
How to use javapackager to create executable file for my code? [closed]
I saw this stack overflow post to know how to create executable files from java source , where it says to use javapackager he also says that it is included with Java JDK but I dont have any clue of ...
1
vote
1
answer
4k
views
Sudden "package doesn't exist" in IntelliJ IDEA
Recently I started to receive the following errors about random packages:
mvn build is working of course, the problem is only for building within Idea.
Sometimes I can fix it with reloading maven ...
0
votes
0
answers
620
views
How to run a java .class file that extends a Class which is in another directory?
I first met this problem in my Ideas, I wrote a Class that extends javax.servlet.http.HttpServlet, My Ideas throws an error message reads Error: Could not find or load main class com.bjpowernode....
0
votes
1
answer
48
views
I tried changing javac.sublime-build-package and i got notification access denied
I was trying to change javac file text
but it was not changing
so I tried to delete and replace it with the below text copy
when I tried deleting javac in Sublime java package
it pops up notification &...
-1
votes
1
answer
141
views
package convention for java Springboot lightweight controllers? [closed]
We have the controllers already being used with many apis in the package
com.mycomp.myapp.controllers
The controllers developed are heavy, so planning to add light weight apis with minimum request ...
1
vote
1
answer
3k
views
What do Java subpackages do, given that they don't provide a special access relationship?
I have seen a number of posts on Stack Overflow and elsewhere assert that Java does not have the concept of subpackages. One thing often pointed out is the lack of any special access relationship ...
0
votes
2
answers
2k
views
Using main class inside the package in java
I am trying to to run the file Demo.java which is calling Protection class within the same package but it is giving error
This is the main class.
package p1;
// Instantiate the various classes in p1.
...
1
vote
3
answers
1k
views
Getting java.lang.ClassNotFoundException when using package
I have a java file ComPac.java with the below code:
package com;
public class ComPac{
public static void main(String[] args) {
System.out.println("Hello World");
}
}
The ...
1
vote
3
answers
1k
views
How to restrict a class visibility in another class only that are in different packages?
I have the following package and class structure in my project,
package de.mycompany.jakarta.order;
import de.mycompany.ordermanagement.order.OrderCancellationService;
public class DrugOrderManager {
...
1
vote
1
answer
1k
views
How do I Import a user created package in Java?
I recently hosted a Maven package on Github's package registry and now I am trying to use it. The package is intended to provide the data models that are used by various applications, allowing my team ...
3
votes
2
answers
3k
views
module-info not compiled unless package classes are compiled with the same command
I've got a folder called myModule. Inside it, there's another folder called myPackage in which my Main.class exists.
Next to myPackage I have my module-info.java which I'd like to compile. First take ...
0
votes
0
answers
70
views
Java Swing application on multiple package
I am currently working on a self-project using Java SE-13 on Eclipse with Window builder.
I intend to create a program that has the following design flow using individual button as the event-source.
...
0
votes
2
answers
268
views
Android Studio : Adding a new java file to an existing package - "Unresolved Reference"
I was looking the HTML to PDF Conversion in android app
I have a problem to do the "it must be in package ".../java/android/print/" from solution number 1.
How can I add the PdfConverter.java in ...
1
vote
1
answer
252
views
Is it possible to make scalatest to discover within package object?
I have several test facets sharing multiple test classes, so I aggregate them into a trait to be mixin into package objects, expecting that those test classes will be discovered under the package:
(...
0
votes
1
answer
97
views
javac adding classpath breaks my local class compilation
When I import a package to my MyLib class (which requires -cp to javac) I can no longer compile my MyMain class.
MyMain.java:
class MyMain
{
public static void main (String [] args)
{
...
-2
votes
1
answer
173
views
Restructuring of package
Hi I am trying to restructure the package but with no luck. Suppose there are multiple packages in a project like:
main.java.com.wms.package1
main.java.com.wms.package2
main.java.com.wms.package3
I ...
0
votes
2
answers
763
views
Whether we import source code or byte code of a class when importing that class in java?
I have started learning packages in java.I learned about the import keyword.Now my doubt is whether it is .class file or a .java file that is being imported while we import any class in java.
16
votes
2
answers
52k
views
TypeError: 'JavaPackage' object is not callable (spark._jvm)
I'm setting up GeoSpark Python and after installing all the pre-requisites, I'm running the very basic code examples to test it.
from pyspark.sql import SparkSession
from geo_pyspark.register import ...
0
votes
0
answers
60
views
I don't understand why I don't have access to my package / class?
I have a class called PointCP2 in a file called design2 and i have
package design; at the top of my class PointCP2. In my test class (PC2Test) which is in the same file I have import design2.*; at ...
1
vote
0
answers
118
views
Access restrictions (modularity) of artifacts in Maven
I know that starting with Java 9 (we're still on 8), it is possible to restrict access to packages for other modules, if you stick to the Java module system. We are doing Java EE and I don't know if ...
1
vote
0
answers
152
views
Any way to organize classes within same package
I'm writing a Java library that has a simple interface, but a lot going on behind the scenes. In order to keep the API surface small, I've kept the library as one large package (so that I can make ...
2
votes
1
answer
330
views
How to organize code logically into package while preserving encapsulation
This is a conceptual question.
I usually organize code in packages logically.
E.g.: math operation goes in my.package.math or business logic goes into my.package.business and so on.
In these days I ...
3
votes
1
answer
2k
views
Can one Java module export a package whose name is a subpackage of a package from another module? [duplicate]
So I know that, in Java 9 modules (Project Jigsaw), split packages are not allowed. That is, the following modules couldn't both export a package with the same name and also be used at the same time ...
1
vote
6
answers
11k
views
Run Java Code without a package in Eclipse IDE
I want to run my code without creating a package in java eclipse IDE.
But when I do so it is showing error :
Must declare a named package because this compilation unit is associated to the named ...
0
votes
1
answer
114
views
committing an executable with separately committed Java packages
My application has 4 Java packages.
com.me.utilities
com.me.widget
com.me.analysis
com.me.interface
All packages depend upon the utilities. The widget package depends upon the interface package.
...
-1
votes
1
answer
117
views
When or which type of java packages are called native? [closed]
Recently I was improving my understanding on Regular Expressions by reading Mastering Regular Expressions Third Edition by Jeffrey E. F. Friedl, there is mentions Java has had a native regex package . ...
0
votes
1
answer
74
views
Access class from another package
I have two folders in a folder called asdsad
.
├── a
│ └── A.java
├── b
│ └── B.java
This is my A.java
package asdsad.a;
public class A {
public A() {
}
public int number;
}
This ...