Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7544525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:41:37+00:00 2026-05-30T08:41:37+00:00

I want to run the Java code below in Matlab. It ran successfully in

  • 0

I want to run the Java code below in Matlab.
It ran successfully in JAVA environment.
I am using

apache-jakarta-commons-net-1.4.1.jar

to run this code.

The software that I use are

MATLAB Version 7.7.0.471 (R2008b)
Operating System: Microsoft Windows Vista Version 6.1 (Build 7600)
Java VM Version: Java 1.6.0_04 with Sun Microsystems Inc. 
     Java HotSpot(TM) Client VM  mixed mode

My java code is

import java.io.IOException;
import org.apache.commons.net.TimeTCPClient;// third party class
public final class TimeClient
{

public static final void timeTCP(String host) throws IOException
{
TimeTCPClient client = new TimeTCPClient();
try {
// We want to timeout if a response takes longer than 4 seconds
client.setDefaultTimeout(4000);
client.connect(host);
System.out.println(client.getDate());
}
finally {
client.disconnect();
}
}

public static final void main(String[] args)
{
{
try
{
timeTCP(args[0]);
}
catch (IOException e)
{
e.printStackTrace();
System.exit(1);
}
}

}

}

which timeclient gave the following error

Warning: A Java exception occurred trying to load the TimeClient class:
Java exception occurred:
java.lang.UnsupportedClassVersionError: TimeClient : Unsupported major.minor
version 51.0

    at java.lang.ClassLoader.defineClass1(Native Method)

    at java.lang.ClassLoader.defineClass(Unknown Source)

    at java.security.SecureClassLoader.defineClass(Unknown Source)

    at java.net.URLClassLoader.defineClass(Unknown Source)

    at java.net.URLClassLoader.access$000(Unknown Source)

    at java.net.URLClassLoader$1.run(Unknown Source)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.net.URLClassLoader.findClass(Unknown Source)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    at java.lang.ClassLoader.loadClassInternal(Unknown Source)

    at java.lang.Class.forName0(Native Method)

    at java.lang.Class.forName(Unknown Source)

    at
    com.mathworks.jmi.OpaqueJavaInterface.findClass(OpaqueJavaInterface.java:470) 
'TimeClient' not found.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:41:38+00:00Added an answer on May 30, 2026 at 8:41 am

    MATLAB is apparently using a different Java version from the one you used to compile your .jar. Make sure to compile it with the Java version used inside MATLAB. Since you didn’t state how you determined the Java version number given in your question, make sure you call

    version -java
    

    from the Matlab command prompt, and then use that version to compile your .jar. More info can be found here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to run a Maven compilation by my Java code. Thus, I've used
I want to run Protovis javascript from Java and get the evaluated SVG code.
I want to package a piece of code that absolutely must run on Java
I have the below code to run a java program from a file. import
I want to run Eclipse Java Development Tools form source code, but I'm stuck
I am using crontab to run a java code on a linux server and
How do I find installation directory of OpenOffice using Java Code? I want to
I want run a script as follows: runner: ssh 'java program &' ssh 'java
I want to run Oracle Forms standalone without any web-browser with java plugin. Is
Why this code don't work,when i want run this code vwd 2008 express show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.