The issue:
When Running the Main class the program terminates without doing anything. This only happens when i import libraries to the project, specifically when i import more then 8 libraries. if i remove them from the build path the program loads just fine.
I have tried almost all the combinations to check if it was a specific library, however i found out that it's only the number of libraries that matter.
There are do any errors on the problems tab nor exceptions when running the app. It just terminates.
This are the libraries i'm importing:
commons-codec-1.10
commons-io-2.4
commons-logging-1.1.3
commons-math3-3.6
junit-4.12
log4j-1.2.17
poi-3.13-beta1-20150723
poi-excelant-3.13-beta1-20150723
poi-ooxml-3.13-beta1-20150723
poi-ooxml-schemas-3.13-beta1-20150723
poi-scratchpad-3.13-beta1-20150723
sqljdbc4
xmlbeans-2.6.0
I have the libraries inside the project, in a folder named lib, and i have already tried to import the libraries by using right click>build path>add to build path, and also buy going to project>right click> build path> configure build path and add the libraries there.
Also i'm using a javafx project and java8.
Related
**UPDATE:
I closed and re-opened eclipse (which I've done before), and was presented with a new "quick fix" solution of moving the library to the module path (which it has been in before), and now I can reference it, but now
import com.jme3.app.SimpleApplication;
says
The package com.jme3.app is accessible from more than one module: jme3.core, jme3.desktop
my module-info now have warnings as well:
module-info.java:
module vast {
requires jme3.core; //Name of automatic module 'jme3.core' is unstable, it is derived from the module's file name.
requires jme3.desktop; //the same(ish)
requires jme3.lwjgl; // and so on
}
I'm going to fiddle around a bit and see what I can figure about those
**
So, I've decided to migrate one of my projects from LWJGL3 to JME3 (using Eclipse). I followed the advice of Setting up JME3 in Eclipse, specifically downloading the library, extracting it to a lib subfolder in my project, I then added the contents of the library to a User-Library (using Add JARs, since they are in my project), and added the library to my classpath. I know eclipse sees the library (code suggestions), but I keep getting access errors.
Setup:
Arch Linux (latest)
Eclipse IDE for Java Developers (2019-12 (4.14.0))
Here's the code (small test class to make sure it runs before I refactor):
Test.java:
package lab.stone.werlious.vast;
import com.jme3.app.SimpleApplication; //the type com.jme3.app.SimpleApplication is not accessible.
public class Test extends SimpleApplication { //SimpleApplication cannot be resolved to a type
}
module-info.java:
module vast {
requires jme3.core; // jme3.core cannot be resolved to a module
}
I've tried many different combinations of adding the library (modulepath, classpath, user library, external JARs, internal lib JARs), and referencing it. I keep getting errors, even though SimpleApplication suggests importing com.jme3.app.SimpleApplication, which suggests adding requires jme3.core to module-info.
I am not using maven or gradle (detest those), and prefer to do things locally. I also prefer eclipse over jme3 sdk. Can someone tell me how to properly import this library (without maven or gradle)? and how to properly import it in my code? I didn't have this issue adding LWJGL3 to eclipse before, and currently jme3 is added the same as lwjgl3 in my source project (jars in lib folder in project, lib folder added as user library, user library added to classpath).
Thank you all for your help
As a side note, because I'm sure someone will mention it, I've been on various forums for about 2 hours trying to figure this out, including stackexchange. I can't find a similar issue with a solution that works for me.
I fixed my problem but I don't know how/why this fixed it so I am looking for an explanation.
I opened my project yesterday and I could no longer build due to the fact that the java and jsp imports could no longer see javax.* classes. I had another project that worked fine but could find no differences in their build paths.
After reading several threads on build path, etc. and not finding any problems in the configuration file I simply retyped the import in one of the source files, eclipse was able to lookup class tree as I typed in the editor, and once one of the imports was retyped the project would now build.
I would like to understand what in the Eclipse project configuration was hit and why this happened and how this method I used actually resolved the problem.
I installed a bunch of updates via Android SDK Manager this morning including Android SDK Tools 22.0.1. This has seemed to be disastrous so far. One disaster is handling libraries. Here is the scenario:
I have a project projFoo that uses a library project libFoo. libFoo uses a dozen or so libraries or projects. In other words, libFoo has the following in its Java Build Path:
projA, projB, projC,...
lib1.jar, lib2.jar, lib3.jar ...
I used to need only adding libFoo to the build path of projFoo, and everything was working fine until I installed the updates.
After the updates, I have been adding projA, projB, lib1.jar one by one to projFoo's build path even though projFoo does not use them directly. Without doing this, java.lang.NoClassDefFoundError would occur when I run the app.
I have cleaned all projects and restarted Eclipse many times. I also checked those referenced projects and libraries in Order and Export of libFoo, but adding those references still seems to be necessary. Is this the right way to handle this?
In the order and export tab of Java Build Path make sure Android private Libraries and Android Dependencies are checked.
Any libraries in .jar format should just go in the libs folder of your project. There's no need to add them to the build path.
Any libraries that are a project can just be added to the Java Build Path Projects tab, or if it is an android project, you can add it to the Library section under the Android pane.
I downloaded the source code from github.com for standard android browser:
https://github.com/android/platform_packages_apps_browser
I opened the project in Eclipse. It showed me a lot of mistakes, mostly related to not connected libraries, but there are errors related to the fact that the class is connected but the corresponding method that is invoked in the class doesnt. Incidentally, it should be noted that when opening the project through File -> New -> Android Project -> then put the tab Create project from existing source and selecting the column Location path to the source com.android.browser, it is not selected version of Android, under which the program is written in the graph Build Target and have it set itself, I tried to choose one by one all and still having the same error.
Here is a partial list of classes that are not found:
import android.net.WebAddress;
import android.app.DownloadManager;
import android.os.ServiceManager;
import android.text.IClipboard;
import android.os.ServiceManager;
import android.text.IClipboard;
import android.speech.RecognizerResultsIntent;
etc.
The same methods were not found or variables connected to the following classes:
Browser.getVisitedLike (cr, url)
Browser.BookmarkColumns.THUMBNAIL
Browser.HISTORY_PROJECTION_THUMBNAIL_INDEX
etc.
I tried to look for com.android.browser on other sites, everything that I found showed me the similar pattern. Can someone explain what the problem is, because all of the standard libraries and classes exist but the project is not created?
I tried to use the Hidden API, as shown on this page:
http://devmaze.wordpress.com/2011/01/18/using-com-android-internal-part-1-introduction/
downloaded from there the platform Hidden API, tried to compile them, some bugs got solved, but more than half the errors still remain.
Please help me figure out how to compile browser from the source code.
The browser project is designed to be built in the context of the entire Android Open Source Project framework. It will not build with just the client App SDK that you have installed.
If you wish to build this browser, you will need to download the complete Android OS project to provide the correct environment.
You may want to look for a different browser (such as Firefox) which is open source and is not so tightly integrated into the OS.
I'm trying to use the JNotify library along with netbeans, however I don't know the proper way to configure it. Everything I try, the lines involving jnotify (eg. import net.contentobjects.jnotify.*) are underlined in red. Google seems to show nothing helpful regarding netbeans with jnotify, although I assume it's something simple like adding it to the classpath. I've tried adding the .jar as a library for compile & for run, no go.
The line i've been provided for running my app from the jnotify page:
-cp jnotify.jar -Djava.library.path=.
should I be using this as my compiling options or VM run options or both? seeing as I don't want to have to distribute my app with a .dll or .so file or the jnotify .jar.
Everyone on this site recommends using such and such a library, but they don't realize how hard they can be to set up (jnotify,boost,curl), and most who recommend them have probably never even used them themselves.
You're right, you have to add every library you use in your programs, into the projects classpath:
Click on the project node in your 'Projects' window. It should by default have a node called 'Libraries'.
Right click this node and select 'Add JAR/Folder'
Locate the JNotify.jar on the file dialog and press 'Open'.
Refresh your project, or just give netbeans some time to rescan the classpath, and you should be good to go.
There definately is something wrong with your classpath. While the above is exactly how you set the classpath when running a Java program, its different for a NetBeans project.
Follow these articles on how to add extenal jars to a NetBeans project.