1

I am new to php/java bridge

<?php

require_once("localhost:8087/JavaBridge/java/Java.inc");
$world = new java("Test");
    echo $world->query("sample");
?>

this is my php file for calling a desktop application's Test class, but it is showing an ClassNotfoundException.

1
  • Could you add the exception as well? It will help determine if it's the test class itself it can't find or something else. Commented Jul 3, 2013 at 12:43

2 Answers 2

3

Check if your Java class is inside a package. If the class is inside a package (eg. com.stackoverflow) you need to instanziate your class with the package name:

$world = new java("com.stackoverflow.Test");
0

Without the exception it looks like you lack the test class in your jvm classpath. You say you want to run a desktop application, so I would suggest you go through this guide (Again? :), to see if you missed something in the setup.

Also you could remove the enter code here block.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.