What im trying to do is to run my expo project on native code with expo run:android command(since firebase cannot run on expo)
When I run the expo run:android it shows me this error:
error: cannot find symbol
import io.invertase.firebase.RNFirebasePackage;
^
symbol: class RNFirebasePackage
location: package io.invertase.firebase
C:\Users\use\Desktop\BeMySafety\android\app\src\main\java\alcoders\bemysafety\MainApplication.java:24: error: package io.invertase.firebase.notifications does not exist
import io.invertase.firebase.notifications.RNFirebaseNotificationsPackage;
^
C:\Users\use\Desktop\BeMySafety\android\app\src\main\java\alcoders\bemysafety\MainApplication.java:40: error: cannot find symbol
packages.add(new RNFirebaseMessagingPackage());
^
symbol: class RNFirebaseMessagingPackage
C:\Users\use\Desktop\BeMySafety\android\app\src\main\java\alcoders\bemysafety\MainApplication.java:41: error: cannot find symbol
packages.add(new RNFirebaseNotificationsPackage());
^
symbol: class RNFirebaseNotificationsPackage
Note: C:\Users\use\Desktop\BeMySafety\android\app\src\debug\java\alcoders\bemysafety\ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors
MainApplication.java
protected List<ReactPackage> getPackages() {
#SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
packages.add(new RNFirebaseMessagingPackage());
packages.add(new RNFirebaseNotificationsPackage());
return packages;
}
How can I solve this error?
Related
I have downloaded junit-4.10.jar and hamcrest-2.2.jar to a folder C:/JUnit.
In Environment Variables->System Variables I Have set JUNIT_HOME as C:\JUnit and CLASSPATH as %CLASSPATH%;%JUNIT_HOME%\junit-4.10.jar;.;
Then I created a folder C:/JUNIT_WORKSPACE and added two files TestJunit.java and TestRunner.java.
Now in command line terminal when I enter:
C:\JUNIT_WORKSPACE>javac TestJunit.java TestRunner.java
It throws the below error:
C:\JUNIT_WORKSPACE>javac TestJunit.java TestRunner.java
TestJunit.java:1: error: package org.junit does not exist
import org.junit.Test;
^
TestJunit.java:2: error: package org.junit does not exist
import static org.junit.Assert.assertEquals;
^
TestJunit.java:2: error: static import only from classes and interfaces
import static org.junit.Assert.assertEquals;
^
TestRunner.java:1: error: package org.junit.runner does not exist
import org.junit.runner.JUnitCore;
^
TestRunner.java:2: error: package org.junit.runner does not exist
import org.junit.runner.Result;
^
TestRunner.java:3: error: package org.junit.runner.notification does not exist
import org.junit.runner.notification.Failure;
^
TestJunit.java:5: error: cannot find symbol
#Test
^
symbol: class Test
location: class TestJunit
TestJunit.java:9: error: cannot find symbol
assertEquals("Junit is working fine",str);
^
symbol: method assertEquals(String,String)
location: class TestJunit
TestRunner.java:7: error: cannot find symbol
Result result = JUnitCore.runClasses(TestJunit.class);
^
symbol: class Result
location: class TestRunner
TestRunner.java:7: error: cannot find symbol
Result result = JUnitCore.runClasses(TestJunit.class);
^
symbol: variable JUnitCore
location: class TestRunner
TestRunner.java:9: error: cannot find symbol
for (Failure failure : result.getFailures()) {
^
symbol: class Failure
location: class TestRunner
11 errors
What did I do wrong here? I assume I have set the HOME and Classpath correctly.
The issue is resolved.
I changed the CLASSPATH to %CLASSPATH%;.;%JUNIT_HOME%\junit-4.10.jar;%JUNIT_HOME%\hamcrest-core-2.2.jar;
and after that on running the commands in cmd, I get the correct response:
C:\JUNIT_WORKSPACE>javac TestJunit.java TestRunner.java
C:\JUNIT_WORKSPACE>java TestRunner
true
C:\JUNIT_WORKSPACE>
I don't have any idee what I make wrong for the beginning with Gluon.
I have IntelliJ IDEA 2018.2.4 (Community Edition)
Build #IC-182.4505.22, built on September 18, 2018
JRE: 1.8.0_152-release-1248-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
install Gluon Plugin Version: 2.7.0
File->new->Project->gluon->Desktop Multi view Project with FXML->java 11->finish
install gradel Gradle 4.10.2 used it as local option in last setup view
I use java version "11" 2018-09-25
I download the javaFx11 (openjfx-11_windows-x64_bin-sdk) and use it in an Structure as a libery
know I have this -->
00:41:11: Executing task 'run'...
> Task :compileJava FAILED
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\actions\MenuActions.java:5: error: package javafx.scene.control does not exist
import javafx.scene.control.Alert;
^
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\actions\MenuActions.java:7: error: package javafx.scene.image does not exist
import javafx.scene.image.Image;
^
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\actions\MenuActions.java:8: error: package javafx.scene.image does not exist
import javafx.scene.image.ImageView;
^
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\PrimaryController.java:7: error: package javafx.fxml does not exist
import javafx.fxml.FXML;
^
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\PrimaryController.java:8: error: package javafx.scene.control does not exist
import javafx.scene.control.Button;
^
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\PrimaryController.java:9: error: package javafx.scene.control does not exist
import javafx.scene.control.Label;
^
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\PrimaryController.java:10: error: package javafx.scene.control does not exist
import javafx.scene.control.TextInputDialog;
^
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\PrimaryController.java:27: error: cannot find symbol
private Label label;
^
symbol: class Label
location: class PrimaryController
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\PrimaryController.java:30: error: cannot find symbol
private Button button;
^
symbol: class Button
location: class PrimaryController
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\SecondaryController.java:6: error: package javafx.fxml does not exist
import javafx.fxml.FXML;
^
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\SecondaryController.java:7: error: package javafx.scene.control does not exist
import javafx.scene.control.Button;
^
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\SecondaryController.java:20: error: cannot find symbol
private Button button;
^
symbol: class Button
location: class SecondaryController
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\GluonApplication.java:4: error: package javafx.scene does not exist
import javafx.scene.Scene;
^
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\GluonApplication.java:7: error: cannot access Application
public class GluonApplication extends ParticleApplication {
^
class file for javafx.application.Application not found
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\GluonApplication.java:14: error: cannot find symbol
public void postInit(Scene scene) {
^
symbol: class Scene
location: class GluonApplication
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\PrimaryController.java:26: error: cannot find symbol
#FXML
^
symbol: class FXML
location: class PrimaryController
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\PrimaryController.java:29: error: cannot find symbol
#FXML
^
symbol: class FXML
location: class PrimaryController
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\PrimaryController.java:32: error: cannot find symbol
#FXML
^
symbol: class FXML
location: class PrimaryController
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\SecondaryController.java:19: error: cannot find symbol
#FXML
^
symbol: class FXML
location: class SecondaryController
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\SecondaryController.java:22: error: cannot find symbol
#FXML
^
symbol: class FXML
location: class SecondaryController
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\actions\MenuActions.java:24: error: cannot find symbol
Alert alert = new Alert(AlertType.INFORMATION);
^
symbol: class Alert
location: class MenuActions
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\actions\MenuActions.java:24: error: cannot find symbol
Alert alert = new Alert(AlertType.INFORMATION);
^
symbol: class Alert
location: class MenuActions
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\actions\MenuActions.java:24: error: cannot find symbol
Alert alert = new Alert(AlertType.INFORMATION);
^
symbol: variable AlertType
location: class MenuActions
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\actions\MenuActions.java:27: error: cannot find symbol
alert.setGraphic(new ImageView(new Image(MenuActions.class.getResource("/icon.png").toExternalForm(), 48, 48, true, true)));
^
symbol: class ImageView
location: class MenuActions
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\actions\MenuActions.java:27: error: cannot find symbol
alert.setGraphic(new ImageView(new Image(MenuActions.class.getResource("/icon.png").toExternalForm(), 48, 48, true, true)));
^
symbol: class Image
location: class MenuActions
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\PrimaryController.java:51: error: cannot access StackPane
app.getParticle().getToolBarActions().add(0, actionSignin);
^
class file for javafx.scene.layout.StackPane not found
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\PrimaryController.java:55: error: cannot access ObservableList
app.getParticle().getToolBarActions().remove(actionSignin);
^
class file for javafx.collections.ObservableList not found
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\PrimaryController.java:65: error: cannot find symbol
TextInputDialog input = new TextInputDialog(stateManager.getProperty("UserName").orElse("").toString());
^
symbol: class TextInputDialog
location: class PrimaryController
E:\IntellijProjects\GluonDesktop-MultipleViewProjectwithFXML\src\main\java\com\gluonapplication\controllers\PrimaryController.java:65: error: cannot find symbol
TextInputDialog input = new TextInputDialog(stateManager.getProperty("UserName").orElse("").toString());
^
symbol: class TextInputDialog
location: class PrimaryController
29 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
1 actionable task: 1 executed
Compilation failed; see the compiler error output for details.
00:41:11: Task execution finished 'run'.
Which step did I make a mistake in?
The Gluon plugin 2.7.0 was released a while ago, mainly to create Gluon Desktop or Gluon Mobile applications with Java 8.
If you are using now Java 11, until there is a new release of the Gluon plugin, you will have to update the build.gradle file.
I'd suggest you have a look at how to get started with JavaFX 11 in this guide, and check this question about adding JavaFX 11 to a project in IntelliJ.
When you use the Gluon plugin you are creating a Gradle project. And for that, you don't need to download the whole JavaFX SDK, you can include it via dependencies from Maven Central.
So edit your build.gradle file, that looks like:
apply plugin: 'java'
apply plugin: 'application'
repositories {
jcenter()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
mainClassName = 'com.gluonapplication.GluonDesktop'
dependencies {
compile 'com.gluonhq:particle:1.1.3'
}
And add the following changes:
According to the guide for Gradle, add a way to find which is your platform:
apply plugin: 'java'
apply plugin: 'application'
def currentOS = org.gradle.internal.os.OperatingSystem.current()
def platform
if (currentOS.isWindows()) {
platform = 'win'
} else if (currentOS.isLinux()) {
platform = 'linux'
} else if (currentOS.isMacOsX()) {
platform = 'mac'
}
repositories {
jcenter()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
mainClassName = 'com.gluonapplication.GluonDesktop'
Add the JavaFX dependencies for your platform:
dependencies {
compile "org.openjfx:javafx-base:11:${platform}"
compile "org.openjfx:javafx-graphics:11:${platform}"
compile "org.openjfx:javafx-controls:11:${platform}"
compile "org.openjfx:javafx-fxml:11:${platform}"
Add the ControlsFX dependency compatible with Java 9+ (by default is using 8.40.14 which was for Java 8) and add the javax.annotation dependency, that is not part of Java 9+:
compile 'com.gluonhq:particle:1.1.3'
compile 'org.controlsfx:controlsfx:9.0.0'
compile 'javax.annotation:javax.annotation-api:1.3.1'
}
According to the guide, you need to add the module-path and add the required modules to the compiler arguments:
compileJava {
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'javafx.controls,javafx.fxml'
]
}
}
And the same for the run arguments. In this case, the access to private API (due to some requirement of ControlsFX), can be done with --add-exports:
run {
doFirst {
jvmArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'javafx.controls,javafx.fxml',
'--add-exports', 'javafx.base/com.sun.javafx.runtime=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.scene.traversal=ALL-UNNAMED',
]
}
}
Save and sync the changes and you should be able to run your Gluon Desktop project.
I want to compile my java class like that: javac ResultSet.java
But I get the following error:
ResultSet.java:5: error: package data does not exist
import data.Spieler;
^
ResultSet.java:8: error: cannot find symbol
private ArrayList<Spieler> meineSpieler = new ArrayList<Spieler>();
^
symbol: class Spieler
location: class ResultSet
ResultSet.java:12: error: cannot find symbol
public native Spieler[] getSpieler();
^
symbol: class Spieler
location: class ResultSet
ResultSet.java:18: error: cannot find symbol
public ArrayList<Spieler> getMeineSpieler() {
^
symbol: class Spieler
location: class ResultSet
ResultSet.java:8: error: cannot find symbol
private ArrayList<Spieler> meineSpieler = new ArrayList<Spieler>();
^
symbol: class Spieler
location: class ResultSet
How can I import the spieler class? Should I set the classpath or is there a other way to fix that?
Go one directory up and then compile it with
javac data/JNIResultSet.java
Update:
Ok, your class JNIResultSet is in package model and it uses other classes in package data.
Then your compile command should be as follows:
javac -cp . model/JNIResultSet.java
The -cp . part means, that your classpath includes the current directory. This is the root of your package hierarchy. So the compiler can find the *.java files in package data and compiles them also as needed.
You see, this can be very complicated. For more classes this will be nearly unmanageable. So you should really consider to use a build system like Ant, Maven or Gradle.
use -classpath while compiling the file as
javac -classpath <path-to-dependent-classes> JNIResultSet.java
It is required only when the Spieler is not on classpath!
for more help refer javac oracle documentation
I'm trying to compile a project with javac in windows, but I'm getting a "package x does not exist" error.
Even if the jar file containing them is in the classpath.
Here is the command, I just added line returns to make it readable:
javac
-d bin
-sourcepath src
-cp
.;
lib/gson-2.5.jar;
lib/jruby-complete-9.1.2.0.jar;
lib/lwjgl-platform-2.9.3-natives-windows.jar;
lib/lwjgl-platform-2.9.3-natives-linux.jar;
lib/lwjgl-platform-2.9.3-natives-osx.jar;
lib/jinput-platform-2.0.5-natives-windows.jar;
lib/jinput-platform-2.0.5-natives-linux.jar;
lib/jinput-platform-2.0.5-natives-osx.jar;
lib/lwjgl.jar;
lib/lwjgl_util.jar;
lib/jorbis-0.0.17.jar;
lib/jinput-2.0.5.jar;
lib/gdx-platform-1.9.2-natives-desktop.jar;
lib/gdx-controllers-platform-1.9.2-natives-desktop.jar;
lib/gdx-freetype-platform-1.9.2-natives-desktop.jar;
lib/gdx-1.9.2.jar;lib/gdx-backend-lwjgl-1.9.2.jar;
lib/gdx-controllers-1.9.2.jar;
lib/gdx-controllers-desktop-1.9.2.jar;
lib/gdx-freetype-1.9.2.jar;
lib/jlayer-1.0.1-gdx.jar;
lib/jutils-1.0.0.jar
src/com/azias/awbe/Launcher.java
And here is the error message:
src\com\azias\awbe\Launcher.java:3: error: package com.badlogic.gdx.backends.lwjgl does not exist
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
^
src\com\azias\awbe\Launcher.java:4: error: package com.badlogic.gdx.backends.lwjgl does not exist
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
^
src\com\azias\awbe\Launcher.java:16: error: cannot find symbol
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
^
symbol: class LwjglApplicationConfiguration
location: class Launcher
src\com\azias\awbe\Launcher.java:16: error: cannot find symbol
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
^
symbol: class LwjglApplicationConfiguration
location: class Launcher
src\com\azias\awbe\Launcher.java:27: error: cannot find symbol
new LwjglApplication(new AdvanceWarsBootleg(), config);
^
symbol: class LwjglApplication
location: class Launcher
src\com\azias\awbe\AdvanceWarsBootleg.java:3: error: package com.badlogic.gdx does not exist
import com.badlogic.gdx.Game;
^
src\com\azias\awbe\AdvanceWarsBootleg.java:4: error: package com.badlogic.gdx.graphics.g2d does not exist
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
^
src\com\azias\awbe\AdvanceWarsBootleg.java:6: error: cannot find symbol
public class AdvanceWarsBootleg extends Game {
^
symbol: class Game
src\com\azias\awbe\AdvanceWarsBootleg.java:7: error: cannot find symbol
public SpriteBatch batch;
^
symbol: class SpriteBatch
location: class AdvanceWarsBootleg
src\com\azias\awbe\AdvanceWarsBootleg.java:9: error: method does not override or implement a method from a supertype
#Override
^
src\com\azias\awbe\AdvanceWarsBootleg.java:17: error: method does not override or implement a method from a supertype
#Override
^
src\com\azias\awbe\AdvanceWarsBootleg.java:19: error: cannot find symbol
super.render();
^
symbol: variable super
location: class AdvanceWarsBootleg
12 errors
Using Java 6 or later, the classpath option supports wildcards. Note the following:
Use straight quotes (")
Use *, not *.jar
so you could simplify your javac statement:
javac
-d bin
-sourcepath src
-cp ".;libs/*"
src/com/azias/awbe/Launcher.java
Also depending on the platform the separator is ; (windows) or : (unix).
I have 2 classes
CLASS1 (the main class)
- calls threading glass
CLASS2 (the threading class)
- calls function
- calls json.simple.jar functons
and a .JAR (https://code.google.com/p/json-simple/)
jar/json.simple.jar
Now the main problem is that i actualy managed to make both classes to compile with those commands
javac -d . -cp '.:jar/json.simple.jar' *.java;
this will create a folder named package1 and then when i try to run it it gives me the error
java javanolo.CLASS1 -jar 'jar/json.simple.jar';
Selected (9) IPS ... <-- this is the first **println**
Exception in thread "main" java.lang.NoClassDefFoundError: org/json/simple/parser/ParseException
at javanolo.CLASS1.main(CLASS1.java:70)
Caused by: java.lang.ClassNotFoundException: org.json.simple.parser.ParseException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
and i assume this is because it is not finding some of the json simple functions. Why that? I've imported them
// json encode/decode
import org.json.simple.JSONValue;
import org.json.simple.JSONObject;
import org.json.simple.parser.ParseException;
and i am sure that i have imported the .jar, because if i run
javac -d . *.java;
error :
import org.json.simple.JSONValue;
^
CLASS1.java:14: error: package org.json.simple does not exist
import org.json.simple.JSONObject;
^
CLASS1.java:15: error: package org.json.simple.parser does not exist
import org.json.simple.parser.ParseException;
^
CLASS2.java:16: error: package org.json.simple does not exist
import org.json.simple.JSONValue;
^
CLASS2.java:17: error: package org.json.simple does not exist
import org.json.simple.JSONObject;
^
CLASS2.java:18: error: package org.json.simple.parser does not exist
import org.json.simple.parser.ParseException;
^
CLASS2.java:148: error: cannot find symbol
public Map<String,String> openAndGetGeoDataByProxy(String ip,String port,int timeout) throws IOException, InterruptedException, ParseException
^
symbol: class ParseException
location: class CLASS2
CLASS2.java:99: error: cannot find symbol
} catch (ParseException ex) {
^
symbol: class ParseException
location: class CLASS2
CLASS2.java:188: error: cannot find symbol
Object jsonObject = JSONValue.parse(line);
^
symbol: variable JSONValue
location: class CLASS2
CLASS2.java:191: error: cannot find symbol
JSONObject jsonArray = (JSONObject)jsonObject;
^
symbol: class JSONObject
location: class CLASS2
CLASS2.java:191: error: cannot find symbol
JSONObject jsonArray = (JSONObject)jsonObject;
^
symbol: class JSONObject
location: class CLASS2
CLASS2.java:194: error: cannot find symbol
JSONObject jsonArray2 = (JSONObject)jsonArray.get("array_result");
^
symbol: class JSONObject
location: class CLASS2
CLASS2.java:194: error: cannot find symbol
JSONObject jsonArray2 = (JSONObject)jsonArray.get("array_result");
^
symbol: class JSONObject
location: class CLASS2
so i know for sure that json-simple.jar is being used when compilation.
The main question is, how can i run CLASS1 and CLASS2 with that .jar file?
Why LINUX based system is so different then the WINDOWS NETBEANS? I mean java is platform independent ...
Ho can i connect NETBEANS to my server trough SFTP so i can code there directly.
Thanks.
EDIT TRIES
i have tried the following commands, none of them works, it gives me the message like i was running the java -help command
try1
java -cp .;jar/json.simple.jar javanolo.CLASS1
try2
java -cp .;'/root/folder/folder/jar/json.simple.jar' javanolo.CLASS1
try3
java -cp .;/root/folder/folder/jar/json.simple.jar javanolo.CLASS1
can anyone help me please (would be better on chat)? i really need this
With this:
java javanolo.CLASS1 -jar 'jar/json.simple.jar'
you run your class and give the rest of the command line, i.e. -jar jar/json.simple.jar as arguments.
What you want is:
java -cp .;jar/json.simple.jar javanolo.CLASS1
or, in a UNIX shell:
java -cp .:jar/json.simple.jar javanolo.CLASS1
Note that your class path is the same in compilation and execution.